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

merging XCF into multiple GIFs (and automated processing in general)

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.

2 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

merging XCF into multiple GIFs (and automated processing in general) Jack McKinney 27 Aug 21:31
jackmc-gimp@lorentz.com 07 Oct 20:15
  merging XCF into multiple GIFs (and automated processing in general) Jeff Trefftzs 30 Aug 20:34
Jack McKinney
2002-08-27 21:31:01 UTC (over 21 years ago)

merging XCF into multiple GIFs (and automated processing in general)

OK, maybe I am a bit too much of a programmer, and also using GIMP the wrong way (I am new to graphics generation), but I can't seem to find my answer in the 1.2 2nd edition users guide or the FAQs. I need to create 15 GIF files. The design of these files is such that I can create an XCF with 4 layers, and each of the 15 GIF images represents one of the possible combinations of the 4 layers (there are 16 ways to choose the layers, one of them is "none", which is an unneeded case as it just gives a blank image 8-).
I thus have two questions:

1. How do I make the 15 GIFs? The documentation indicates that I need to merge the layers, and make the image indexed, at which point I can save it as a GIF. However, this changes my source "image" (the XCF file). Will I have to close the image without saving changes and then reopen for all 15 images???

2. Q1 might be more of a programmatic issue. As I said, I am think a bit too much as a programmer, and I am think of the XCF file as a source file, and the GIFs as "compiled" images. That having been said, perhaps the standard model in the graphics world is that you don't spend time saving time and just do the work 15 times.
If not, the my second question is, given the XCF file and its 4 layers, is there any way to have gimp process it into the 15 GIF files in an automated way? I.e., without starting up a gimp GUI, but instead from a command line where I want to specify which layers to merge, and with which other parameters (# of colors, etc.) I want to build each GIF. In other words, I want to "edit" the "source" XCF file, and then put gimp commands into my Makefile to "compile" the "source" file into the 15 final images (probably with one command for each image). This is really icing, as it means that if I ever have to change some aspect of the 15 images, I only have to change 1 file instead of manually regenerating 15, not to mention that I only check in one source file into CVS instead of 16 files, all of which have to be changed whenever one is changed...

Am I thinking too much like a programmer, and not enough like a graphics designer, or I am missing something?

Jeff Trefftzs
2002-08-30 20:34:39 UTC (over 21 years ago)

merging XCF into multiple GIFs (and automated processing in general)

Hi Jack -

No, you're not thinking too much like a programmer. This sounds like a perfect candidate for a script-fu. How fluent are you in scheme?

In outline, you want to

a) open your original image with its 4 layers b) in a loop, duplicate it into a new image (gimp-channel-ops-duplicate) c) select the desired layers
d) do whatever else you want to do
e) flatten/merge-visible-layers and f) save the duplicated image.

My own choice would be to write this as an interactive script, where you simply call it with the original image already open. You could then let the script generate the various combinations of layers depending on how many layers the original image contained. Or how many visible layers it contained. Or whatever -- I'm sure you can see where this is going.

You can do this in scheme if you're on windows, or in scheme or Perl if you're running Linux. The PDB explorer in the toolbox Xtns menu will give you details on all of the gimp functions you'll need.

HTH,