Image Magick thumbnail batch resizing

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Forgive me, this is most definitely off-topic or the wrong group
altogether. I just cant find an imagemagick specific newsgroup or message

Nevertheless, perhaps someone here happens to know the answer to my

I usually run a simple bash command to generate thumbnail images from
within a given originals/ directory, placing the thumbs in a ../thumbs
directory, and saving them at 85% jpeg compression:

for i in *.jpg
do convert -quality 85 -sample x75 $i ../thumbs/`basename $i .jpg`.jpg;

The resulting images however look pretty bad, even if I do it at 100%
quality, the effect is comparable to as if the images would have been
sharpened over and over again way too many times.

While if I generate a thumbnail overview using the following command:

display 'vid:*'

.... all images then look very clear and smooth and quite perfect, but this
command does not produce the end result I need, because vid (or visual
directory) generates one large image with all thumb-images incorporated
into that one image. I need separate images for each.

As both 'convert' and 'display' utilize imagemagick, I guess it should in
theory be possible to get the same quality either way.

Does anyone knows how the "display vid" procedure acheive such good result,
and how I can get equivalent quality using a simple batch convert?

Or are there any suitable perl tools (modules) that could be useful here?

Re: Image Magick thumbnail batch resizing

Quoted text here. Click to load it

I think you want to scale instead of sample

  do convert -quality 85 -scale x75 $i ../thumbs/`basename $i .jpg`.jpg;

Quoted text here. Click to load it

PerlMagick gives you access to all of ImageMagick from within Perl,
but it doesn't do anything differently.

Alternatively, you could use Image::Resize or GD itself.

I hope this helps,


Re: Image Magick thumbnail batch resizing

Spartacus wrote:
Quoted text here. Click to load it

I'm accessing ImageMagick from the Perl module Image::Magick:

     use Image::Magick;
     my $image = Image::Magick->new;

Gunnar Hjalmarsson

Site Timeline