[Israel.pm] Creating image thumbnails
Yuval Yaari
yuval at windax.com
Sun Apr 25 02:45:14 PDT 2004
`man convert`. Comes with ImageMagick.
I had to resize around 600 images once and I thought I found the easy
way out with this tool (because I can run it from the command line).
I ran it, but I wasn't happy with the quality.
Since I really like photoshop, I just recorded an action and you have (I
don't have windows at work so it's from my memory) File->Automate->Batch
and you can run this action on an entire directory (w/ sub-directories
if you like)...
It took more time than convert, but the results were much better.
Also, making the action was really quick: open the image, create an
action, press the "record" button, Image->Size change the image size (by
pixels or percents) click ok, Ctrl+Alt+Shift+S ("save for web" - this is
great for web optimization), choose a different directory (let's say
"thumbnails"), don't change the default file name (otherwise it'd always
use that name in all the images...) click save, close the image (click
on "don't save changes") and press the stop button on the actions windows.
Sorry if I got some mistakes, I don't have photoshop nearby. Might seem
complex, but it's too easy - took me less than 1 minute.
You'd just have to wait for photoshop to run the action on all the
files, but the results are worth it, really.
If it must be on-the-fly, then PerlMagick would work, but the quality
doesn't get near photoshop's.
I think the docs have some sample for resizing images - it should be
pretty easy.
I'd also look into GIMP modules for Perl - but I really hate that program.
--Yuval
P.S: Why do some thumbnail generators produce better quality than
others? It's all about the resizing algo - you must lose details in
order to resize your image.
Some make it hardly noticable (like photoshop :)) and some make a
pathetic attempt (ImageMagick)...
Don't hate me because I prefer the "capitalist" software over OSS, but I
must admit the gap is HUGE...
Ran Eilam wrote:
>These are some questions for a friend who wants to create image
>thumbnails and is considering Perl:
>
>1) What is the best, simplest, module for doing this?
>
>2) Why do some thumbnail generators produce better quality output than
>others?
>
>Ran
>
More information about the Perl
mailing list