GIMP Chat
http://gimpchat.com/

Performance of adjusting layers and exporting with Python Fu
http://gimpchat.com/viewtopic.php?f=9&t=19109
Page 1 of 1

Author:  lam3001 [ Sat Jan 30, 2021 1:24 pm ]
Post subject:  Performance of adjusting layers and exporting with Python Fu

I've written some Python Fu and I am running GIMP from the command line in background mode. My script opens a PSD, changes the fill color of some solid fill layers, pastes an image into a new layer, and then exports a new composite. All this takes around 8 seconds or so on a beefy Windows gaming laptop using the latest stable GIMP 2.10.22. Maybe half that if I don't paste a new image layer in. This really is fantastic -- I don't know of any other open source tools that could do this so well. But I would love to be able to speed it up 10x. Any thoughts on performance?

Author:  Tas_mania [ Sat Jan 30, 2021 3:21 pm ]
Post subject:  Re: Performance of adjusting layers and exporting with Python Fu

Gimp is 'ram dependent' but you are not dealing with image sizes of thousands of layers so it's not an issue. Looks like the process is slow because it's sequential.

Other than optimizing your code (I can't help there) using Gimp in OpenCL mode rather than CPU mode would speed up everything. I don't think OCL is fully implemented in Gimp yet. OCL uses graphics cards (GPU's) to process graphics operations which is a lot faster, especially with more than 1 graphics cards.

Author:  paynekj [ Sun Jan 31, 2021 1:33 pm ]
Post subject:  Re: Performance of adjusting layers and exporting with Python Fu

If you're not doing anything with text, make sure your command line includes the -f option to not load fonts.
Similarly the -d to not load brushes, patterns gradients etc might save you some time.

Author:  lam3001 [ Mon Feb 01, 2021 11:28 am ]
Post subject:  Re: Performance of adjusting layers and exporting with Python Fu

paynekj wrote:
If you're not doing anything with text, make sure your command line includes the -f option to not load fonts.
Similarly the -d to not load brushes, patterns gradients etc might save you some time.


Thank you I am already doing that with "-ifds" although in the future I will need to be able to use the patterns feature.

Author:  ofnuts [ Thu Feb 04, 2021 5:50 am ]
Post subject:  Re: Performance of adjusting layers and exporting with Python Fu

If you start an "empty" Gimp instance then you avoid loading the Gimp code each time.

Alternately, if you want to process several files, you can also provide them as a list (or pass a directory) to a script that will process each in turn. This also avoid reloading Gimp each time.

Author:  lam3001 [ Fri Feb 05, 2021 1:43 pm ]
Post subject:  Re: Performance of adjusting layers and exporting with Python Fu

Thanks I will look into that. I do already have some logging that indicates to me the GIMP startup time is minimal and the time is spent exporting a flattened / composite image.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/