RSS/Atom feed Twitter
Site is read-only, email is disabled

Automating scaling tasks

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

Automating scaling tasks Richard C. Steffens 03 Apr 01:26
  Automating scaling tasks Steve Stavropoulos 03 Apr 01:49
  Automating scaling tasks Jeff Trefftzs 03 Apr 01:57
  Automating scaling tasks David Hodson 03 Apr 05:17
Richard C. Steffens
2005-04-03 01:26:21 UTC (about 19 years ago)

Automating scaling tasks

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.

Steve Stavropoulos
2005-04-03 01:49:28 UTC (about 19 years ago)

Automating scaling tasks

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...

Jeff Trefftzs
2005-04-03 01:57:19 UTC (about 19 years ago)

Automating scaling tasks

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,

David Hodson
2005-04-03 05:17:47 UTC (about 19 years ago)

Automating scaling tasks

Richard C. Steffens wrote:

Is there a set of instructions for automating the task of scaling images?

Use the DBP plugin. All gui-driven, no scripting needed.

Source version: http://members.ozemail.com.au/~hodsond/dbp.html Windows compiled version: http://schumaml.gmxhome.de/downloads/gimp/