[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: GImp batch mode

TongKe Xue wrote:
Hi all,

  I want to use gimp to convert a bunch of files from one image format
to another.

"man gimp" returns nothing.

  "gimp --help" mentions the option "--batch <commands>" ... sounds
like I should be able to write some script -- can anyone offer
pointers / enlighten me on this?


You could use ImageMagick to do this job for you. To learn more about ImageMagick's use check out this tutorial:


The command you need to convert formats has a tutorial at this url:


For example here is a hacked together script that I use every now and then to rotate all the photos in directory -- be aware that it will replace the original images with the rotated ones! I should probably fix things to store the rotated images elsewhere :-(

Hope this helps,


# Name: rotateemall
# Author: Clint Harshaw
# Date Late Modified: 19 MAR 2004

# Rotate all jpg files in a directory

use strict;

print "\nEnter path: ";

my $dirname = <STDIN>;
chomp $dirname;

opendir(DIR, $dirname) or die "I'm afraid I can't open the directory named $dirname: $!";

while (defined(my $file = readdir(DIR))) {
    next unless $file =~ /^*.jpg$/;
    system "mogrify -rotate '90>' $file";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]