Page 1 of 1

Fastest way of scaling an image (thumbnail generation)

Posted: 2008-02-08T14:30:00-07:00
by tomf
Whats the fastest way of scaling an image? Most images are jpgs, and I don't really care about the quality. It should just be fast.

I tried:

Code: Select all

convert image.jpg -size 256x256 -thumbnail 256x256 output.jpg
but it's much slower (10 times) than for example irfanview. It looks better - yes - but I don't need the quality.

Re: Fastest way of scaling an image (thumbnail generation)

Posted: 2008-02-08T15:24:04-07:00
by magick
Put the -size option before your image filename.

Re: Fastest way of scaling an image (thumbnail generation)

Posted: 2008-02-08T18:51:41-07:00
by fmw42
Also if you use png for the output then jpg compression does not slow things down. The file sizes will be larger. So I am not sure which will be slower, doing the jpg compression or the larger size file writing. You may want to test this and get back to the forum with what you find. I think we would all be interested. Unless someone already knows.

Re: Fastest way of scaling an image (thumbnail generation)

Posted: 2008-02-09T01:36:35-07:00
by tomf
jpg ist faster:

Code: Select all

===  convert -size 256x256 1.jpg -thumbnail 256x256 thumbs/1.jpg ===

Execution time: 0.375 s

Code: Select all

===  convert -size 256x256 1.jpg -thumbnail 256x256 thumbs/1.png ===

Execution time: 0.506 s
The -size argument before the filename makes it faster but not fast enough. Can't I use a simpler scaling-filter?

Here is a picture taken from irfanviews batch conversion:
Image
And here from imagemagick (the quality is better which I don't need)
Image

Re: Fastest way of scaling an image (thumbnail generation)

Posted: 2008-02-09T08:41:52-07:00
by magick
Next up, use -sample instead of -thumbnail.