[Israel.pm] Creating image thumbnails

Shlomi Fish shlomif at iglu.org.il
Sun Apr 25 03:43:43 PDT 2004

On Sunday 25 April 2004 12:45, Yuval Yaari wrote:
> `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.

Hmmm... interesting.

> [Photoshop stuff snipped...]
> 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.

Well, without getting into Gimp vs. Photoshop religious wars here, (I happened 
to find GIMP much easier to use than Photoshop), it is in fact possible in 
the GIMP using the Perl bindings.

What you need to do is:

1. Make sure gimp is kept running (or a daemon part of it - don't know).

2. Make sure the Perl-scripts server is running.

3. Write a Perl script that scans the images directory, and uses the 
appropriate GIMP Procedural Database (PDB) functions to open the file, 
determine its size, calculate the desired thumbnail size, resize the image, 
and save it as a new filename.

Part 3 at least can be done in batch mode, as opposed to Photoshop for which 
it may not be possible, or the program may not be available on your platform 
of choice.


	Shlomi Fish

Shlomi Fish      shlomif at iglu.org.il
Homepage:        http://shlomif.il.eu.org/

Quidquid latine dictum sit, altum viditur.
        [Whatever is said in Latin sounds profound.]

More information about the Perl mailing list