[Gimp-user] Automating scaling tasks

2005-04-02 Thread Richard C. Steffens
Is there a set of instructions for automating the task of scaling images?

I have a large number of images that I want to scale to three different sizes. 
I successfully do this manually, and it doesn't take too long, but I'd like 
to find (or create -- but I can't imagine someone hasn't already done this) a 
script to run that will do this for me. 

I would point the Gimp to a directory containing links to images, and have the 
script cycle through all the images, creating three copies of each image, 
each scaled to a different size and leaving them in that directory. To get 
even fancier, I'd save each size in a sub-directory.

Thanks for helping a Gimp newbie.

-- 
Regards,

Dick Steffens
___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Automating scaling tasks

2005-04-02 Thread Steve Stavropoulos
On Sat, 2 Apr 2005, Richard C. Steffens wrote:

 Is there a set of instructions for automating the task of scaling images?
 
 I have a large number of images that I want to scale to three different 
 sizes. 
 
 each scaled to a different size and leaving them in that directory. To get 
 even fancier, I'd save each size in a sub-directory.
 

 Take a look at this sample bash script I just wrote for you: (it uses the 
convert program from ImageMagick)

mkdir small
mkdir medium
mkdir large
for i in *jpg; do
convert -resize 150x150 $i small/`basename $i .jpg`-small.jpg;
convert -resize 640x480 $i medium/`basename $i .jpg`-medium.jpg;
convert -resize 1600x1200 $i large/`basename $i .jpg`-large.jpg;
done

 I haven't test it in any way, so be carefull. I hope this 'll get you 
started...

___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Automating scaling tasks

2005-04-02 Thread Jeff Trefftzs
On Sat, 2005-04-02 at 15:26 -0800, Richard C. Steffens wrote:
 Is there a set of instructions for automating the task of scaling images?
 
 I have a large number of images that I want to scale to three different 
 sizes. 
 I successfully do this manually, and it doesn't take too long, but I'd like 
 to find (or create -- but I can't imagine someone hasn't already done this) a 
 script to run that will do this for me. 
 
 I would point the Gimp to a directory containing links to images, and have 
 the 
 script cycle through all the images, creating three copies of each image, 
 each scaled to a different size and leaving them in that directory. To get 
 even fancier, I'd save each size in a sub-directory.
 
 Thanks for helping a Gimp newbie.
 
ImageMagick is your friend here.  It's specifically designed for just
the type of batch operations you're wanting.  Check out

man convert
man mogrify
and 
man ImageMagick for more details.

Basically you would write a quick shell script along these lines:

#!/bin/bash
indir=/directory/with/original/pix
bigpix=/direceory/with/big/output
medpix=/directory/with/med/pix
thumbpix=/directory/with/thumbnail/pix
thisdir=`pwd`

cd $indir
for $img in *.jpg
do
convert -size 800x800 -resize 800x800 $img $bigpix/$img_big.jpg
convert -size 640x640 -resize 640x640 $img $medpix/$img_med.jpg
convert -size 120x120 -resize 120x120 $img $thumbpix/$img_thumb.jpg
done
cd $thisdir

#  end of bash script

HTH,

-- 
Jeff


___
Gimp-user mailing list
Gimp-user@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user