Author Topic: Automation Command for Batch Processing  (Read 624 times)

Automation Command for Batch Processing
« on: 15 June, 2013, 02:51:55 pm »
I want to perform some simple actions on a series of similar files, and would like to automate this.

The necessary actions are:

Open file PageX.png with GIMP
Convert file to Indexed Mode (256 colours, which seems to be the default option when I've done it manually)
Save file as PageX.tif

I'm reasonably familiar with using a script, and having a $ to hold a variable (X in this case) as a command-line option, but how to invoke GIMP with the necessary parameters is where it goes beyond my knowledge.

Any advice gratefully received.

redshift

  • High Priestess of wires
    • redshift home
Re: Automation Command for Batch Processing
« Reply #1 on: 15 June, 2013, 03:36:13 pm »
I don't have a proper syntax for you, but would ImageMagick not do this from the command line?

Something like
Code: [Select]
convert pageX.png -colors 256 pageX.tif
with appropriate script to select the series of files?

<edit> in fact, I've used the ImageMagick mogrify command at work before now, but I've just been reminded that it can be very destructive.

There are batch file examples for conversion on the IM site: http://www.imagemagick.org/Usage/basics/#convert
L
:)
Windcheetah No. 176
The all-round entertainer gets quite arsey,
They won't translate his lame shit into Farsi
Somehow to let it go would be more classy…

Re: Automation Command for Batch Processing
« Reply #2 on: 15 June, 2013, 03:45:52 pm »
Thanks, redshift.

Well I do have ImageMagick installed on my Debian system, and I can see how it would obviate the need to use GIMP for what are a couple of simple conversions, but I've not yet found a definitive example of the syntax to use.

Maybe an ImageMagick expert can help out.  I'll keep looking meanwhile...

Re: Automation Command for Batch Processing
« Reply #3 on: 17 June, 2013, 12:54:57 pm »
Basic PNG to TIFF conversion using ImageMagick's convert is simply:

convert foo.png foo.tiff