Gimp-Forum.net
Speeding up gimp scripts - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: Speeding up gimp scripts (/Thread-Speeding-up-gimp-scripts)



Speeding up gimp scripts - DaltonCalford - 12-30-2022

I have a process that runs, but is very slow.

I am looking for ways to speed up gimp - such as stopping the gimp UI from updating for every step it is performing.

I am running Script-Fu and the process itterates through a series of layers called "textures" and another series of layers called "templates"
and it performs a series of steps based upon the template and for each step, saves the result to a file in the appropriate directory.

It takes about 2 seconds per file output, but, given the number of files to be generated, it could take weeks, so even a small optimization would make a large difference.

I am running on linux, writting to a ssd, with 64GB of ram which is barely touched.   I have a high end amd cpu (12 core) and a high end video card, but, it is still running slow.

So if it is trying to say, keep a undo log or any other unnessary steps, how do I shut those off?

Any help is appreciated.

Thanks


RE: Speeding up gimp scripts - Ofnuts - 12-31-2022

See gimp_image_undo_freeze(image) & gimp_image_undo_thaw(image) if you play directly with the image, and gimp_image_undo_disable(image) if you start by duplicating the image or work on temporary images. Recent Gimp also has gimp_image_freeze_{layers|channels|paths}(image) calls to prevent updates to the previews in the layers, channels and paths lists.

If you save to PNG your problem could be the PNG export which is slow if you use the high compression factors. Using a low compression can make this much faster while not making much change to the size of the result.