r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[View] discuss view related issues

Geomol
12-Jan-2010
[9410x3]
Just a test:

set 'resize func [img /local sz c1 c3 i2] [
	if file? img [img: load-image img]

	scale: img/size/x / 160
	sz: as-pair 160 round img/size/y / scale
	c1: 1x0 * sz
	c3: 0x1 * sz


 i2: to-image layout [origin 0 box sz effect [draw [image img 0x0 
 c1 sz c3]]]
	save/png %img.png i2
]
Call RESIZE with a loaded image. It'll save the img.png file, that'll 
have x-size of 160. It looks ok here.
Change the 160 to some other value, if you need other size.
Dockimbel
12-Jan-2010
[9413]
That's almost the code I've made already. The issue is not having 
BILINEAR or any other good enough filter for thumbnails.
Geomol
12-Jan-2010
[9414]
(or give it as an argument)
Dockimbel
12-Jan-2010
[9415]
I'm working with 64x64
Geomol
12-Jan-2010
[9416]
It seems to be ok without the filter, so maybe some default filter 
is in action. Let me check...
Dockimbel
12-Jan-2010
[9417]
Lanczos (IrfanView) is giving incredible good results.
Pekr
12-Jan-2010
[9418x2]
couldn't convolve filter be used somehow?
I use lanczos in XnView by default ...
Henrik
12-Jan-2010
[9420]
you can blur the image before downscaling, but it can smear it more 
and the image isn't as clear.
Dockimbel
12-Jan-2010
[9421]
How do you access CONVOLVE operator? (can't see it in Draw documentation)
Pekr
12-Jan-2010
[9422]
btw - nconvert is 1.8MB one single exe with all filtering capability 
of xnview inside. Should be cross-platform too IIRC. But - the licence 
might not fit, I don't know ...
Geomol
12-Jan-2010
[9423]
Doc, my version seems filtered to me. Have you tried?
Pekr
12-Jan-2010
[9424]
do http://www.rebol.com/view/demos/convolve.r
Dockimbel
12-Jan-2010
[9425x2]
Geomol: I'll try it right now.
This is what I get with my current code : http://softinnov.org/tmp/thumbs64.png
Geomol
12-Jan-2010
[9427]
Hm, different to say 100%, if my version is filtered. Some results 
look ok, others maybe not so good.
Dockimbel
12-Jan-2010
[9428x4]
left=REBOL, right=IrfanView
The original image is the CureCode homepage viewed inside Chrome 
(http://curecode.org)
Geomol: same result with your code.
Looking at the nconvert solution...
Geomol
12-Jan-2010
[9432]
Yeah, you're right. Too bad. :-/
Dockimbel
12-Jan-2010
[9433]
Looks like NConvert is a good solution for now. It's simple enough, 
supports the right filters and is multiplatform.
Geomol
12-Jan-2010
[9434]
I tried resize both under Windown and OS X with same result. No filtering.
Dockimbel
12-Jan-2010
[9435x2]
Pekr, thanks for NConvert link and for pointing me to Convolve operator, 
pity it's not mentioned in any of the View doc I know of.
Convolve effect could actually help get Lanczos filter implemented 
at mezz level with decent speed.
BenBran
12-Jan-2010
[9437]
view layout [text-list "this" "is" "a" "text" "list"]
myFile.txt contains "this" "is" "a" "text" "list"
how can I:
view layout [text-list read %myFile.txt]
? 
tia
Graham
12-Jan-2010
[9438x2]
everything inside the layout [  ]
is not rebol code .. it's a dialect
VID = Visual Interfaces Dialect.
Pekr
13-Jan-2010
[9440]
Doc - Cyphre confirmed bilinear filter is missing in R2 draw. It 
could be added, if we wish so for R2 updates. In R3, there is new 
parameter for such purposes, called RESAMPLE
Graham
13-Jan-2010
[9441]
so you can do this ... get the block first

data: to-block read %myfile.txt

and then compose on the block

view layout compose/only [ text-list (data) ]
BenBran
13-Jan-2010
[9442]
Thanks Graham. 
view layout compose [text-list (data)] ; worked
WuJian
13-Jan-2010
[9443]
view layout [text-list data parse read %myfile.txt  ""]
Dockimbel
13-Jan-2010
[9444x3]
Pekr: thanks for the confirmation. Why does it appear in documentation 
then? http://www.rebol.com/docs/draw-ref.html#section-3.15
Anyway, thanks to you and nconvert, I could deliver the new CureCode 
feature to my customer this morning.
I think I'll drop View support in Cheyenne completely in the next 
release and search for a suitable third party graphic library to 
add.
Henrik
13-Jan-2010
[9447]
good idea
Pekr
13-Jan-2010
[9448]
If View sucks, well then. But it is a good measure of how it is "usable" 
in real-life ...
Maxim
14-Jan-2010
[9449x2]
try image magic.  its fast, easy to use on the command-line, it can 
process in up to 640 bits images and there is limit on capacity as 
it can actually use disk as ram while its processing!  I rendered 
20GB worth of images into one composite ... using 500MB of ram.
and there are no higher quality engines out there... but that all 
depends if it does what you need in terms of image and graphics.
Henrik
14-Jan-2010
[9451]
we can't build an extension for imagemagick yet, can we?
Maxim
14-Jan-2010
[9452x2]
yes we could.
I hadn't even tought about that
Henrik
14-Jan-2010
[9454]
at this rate, we could have a dozen extensions by spring.
Graham
14-Jan-2010
[9455]
Do we have any extensions yet?
Henrik
14-Jan-2010
[9456]
two so far, AFAIK
Graham
14-Jan-2010
[9457]
and they are available somewhere ?  What are they?
Henrik
14-Jan-2010
[9458]
Not available yet. Not sure they will be, but maybe. Robert is working 
on an SQLite extension and a Windows COM interface.
Maxim
14-Jan-2010
[9459]
there is a text to speach extension that has been released on the 
extensions group.