I would like to find a way to batch process all the jpeg’s in a directory, this process being: load the jpeg > apply wavelet decompose plugin > save as .xcf to keep all the layers.
Any idea how to do that?
I found how to call the plugin (using BIMP), but I don’t know how to save the .xcf image with all layers un-flattened.
Maybe… When I use a script and save to xcf an image with several layers, I can only save the base layer. But I don’t really understand the drawable/layer stuff in scripts.
Unfortunately, it’s not good: it saves as many files as there are layers in the opened file, though each saved file has all the layers. In other words, if a file has 3 layers, the plugin creates 3 copies of the file with 3 layers in each.
Did you really try or did you get abused by the fact that the API takes a drawable(*)? I think that parameter is here only to make the XCF case similar to the “flat” formats, and when I use that API it saves all the layers (as well as selection, channels, and paths).
(*) Note that in other file-*-save functions, the drawable is described as “The drawable to save”, but the description in file-xcf-save is different.
Sorry about bad advice yesterday
I blame the fact that it is more than 20 years since I script-fu’d last time.
a) Of course it ought to be possible to script what you are after!
b) On this particular computer I have The Gimp 2.99.1 installed.
Shortcut / takes you to Search and Run a command, where Save a copy
exists. Are you able to tame Gimp commands? If so, that could be a way out of your dilemma.
Hello,
I found this command in Gimp 2.10. I’ll see if I can manage to call it in batch command line mode after wavelet decompose…
But if I lose too much time searching for a solution, it’s not worth it as I was trying to find a script to lose less time…
I found the solution!
Using the changes for batch mode in command line introduced since Gimp 2.10, here’s a command to apply the wavelet-decompose plugin, and save the images untouched with all the layers as .xcf files: