Lumo wrote:
Please can someone help me create this script? I want GIMP to do the following to each file in a folder:
-Import an existing image as a layer above the image that's being processed. This layer is a .png file with a fixed name and location.
-Set the layer mode of the new layer to "divide".
-Flatten all layers
-Change the colour mode to Indexed and select a preset Palette.
-Export the file to a different directory as a .png (and close the opened file).
It's not exactly "my first script" stuff so I'm hoping someone here can save me a dozen hours :-)
Thank you!
Why Gimp? This kind of processing is best handled by ImageMagick and a shell script (.BAT, in Windows). It will take you less time to figure out the necessary ImageMagick call (they have a nice forum, otherwise) that to come up with the equivalent Gimp script.
Start here:
http://www.imagemagick.org/Usage/compose/Otherwise, if the number of files is reasonable (ie, the whole set fits in memory) (or if you can work in reasonably sized sets):
- load the additional layer in one image
- in a second image, use File>Open as layers to load all (or a reasonably sized subset of) the images you want to process
- use my
interleave-layers script (title mode) to interleave a copy of you additional layer and merge it down with divide mode
- use some script to save the resulting layers as PNGs (I haven't got one, but such a script isn't hard to find).