Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GIMP Python-Fu Export all open images to pdf
#8
(04-01-2022, 08:37 PM)Ofnuts Wrote: Some remarks:

  • Saving all images in sight isn't a very sound idea. You don't know what other unrelated images the user may have opened, and there could even be images created by scripts and not visible because not associated with a Display.
  • If your script runs on all images it doesn't need a PF_IMAGE parameter
  • The undo_group_start/undo_group_end isn't useful since it only applies to the initial image. If you want this you have to do it on subimage inside of the loop
  • By contrast the gimp_context... calls applies to the "context" which is image-independent, so you can do this outside of the loop
  • To properly restore the opacity, bracket the code with gimp_context_push/gimp_context_pop
  • On the other hand I don't see where the opacity applies, it is typically used for Paint tools

These are useful for me so I will go through each of them.
* I saved all open images because I did not know any other way of accessing the images after modifying them. Please let me know if there is a better way.
* I was wondering whether to keep it or not, I kept it initially because I was experimenting the noise effect with a single image.
* I initially did that inside the loop but then I saw in another post on stackexchange I think where someone said a single undo is enough so did this.
* I wanted to access the opacity/radius parameter that is used for different blur/noise effects. Opacity can be configured within plugins whereas radius has to be configured outside the plugin. Please let me know if there is a reliable way to do this. I didn't find the official documentation particularly self-containing for API information.
Reply


Messages In This Thread
RE: GIMP Python-Fu Export all open images to pdf - by billalmasum93 - 04-02-2022, 03:46 PM

Forum Jump: