Mobile app version of vmapp.org
Login or Join
Alves566

: Gimp: export XCF as a list of commands? It took me a lot of time to create a graphic in GIMP, and now I need to make some variations of the same graphic that actually only require the

@Alves566

Posted in: #Gimp #Text #Workflow

It took me a lot of time to create a graphic in GIMP, and now I need to make some variations of the same graphic that actually only require the change of the FG color twice in the process.

The GIMP "raw" files are created as XCF. If I look inside (using Emacs), while it's a binary file, I can distinctly see a text command, like

(fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000))


It would appear to me that GIMP stores - in its own binary format - a list of commands that it "replays" when the XCF is opened(?).

Maybe not - anyway my point is to have an editable list of "commands" (or similar) that could be text-editable, this way I would just change the two FG lines and a copy of the file to get the variations.

I need to repeat that process 10+ times, and such a text approach - Perl scriptable for instance - would save a lot of time.

Is it possible? Are there other ways to do this that do not require to open the XCF and repeat the whole long process while changing only the FG?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Alves566

1 Comments

Sorted by latest first Latest Oldest Best

 

@Samaraweera207

Here's what I would do:


Look into creating a Gimp Script-fu, which is like a macro (link).
If that doesn't work, try to find a solution using Imagemagick.


In Gimp, export your entire image as something like: image.png
Then adjust layer visibility so that only the foreground is showing, and everything else is transparent.
Export this file as something like: image_foreground.png
Now use imagemagick to change the colour of the foreground file and superimpose it on the background.


Download appropriate binary (link) and follow installation instructions. Most linux distrobutions have it installed by default.
Modify the colour of the foreground image (additional info):

### Don't have imagemagick right now. Will add code later. ###

Overlay the new foreground onto the background (additional info):

composite -gravity center image_foreground.png MyImage: image.png

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme