Gimp-Forum.net
Panorama Projection - 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)
+---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions)
+---- Thread: Panorama Projection (/Thread-Panorama-Projection)



Panorama Projection - patrislav - 07-26-2024

Hi,

I need to script Filters -> Map -> Panorama Projection, but can't find it in the Procedure Browser.
Did I miss something, or is it just not available?

(GIMP 2.10 on Ubuntu 24.04)

TIA
Patrick


RE: Panorama Projection - rich2005 - 07-26-2024

(07-26-2024, 10:42 AM)patrislav Wrote: I need to script Filters -> Map -> Panorama Projection, but can't find it in the Procedure Browser.
Did I miss something, or is it just not available?

It is a GEGL function so does not register in the pdb.

You can see the parameters here:  https://gegl.org/operations/gegl-panorama-projection.html

It is possible to script in python a GEGL function using a utility plugin, gegl_command.py
The plugin with a very simple example is in this recent post.
 https://www.gimp-forum.net/Thread-How-do-I-use-the-non-legacy-version-of-Emboss-from-Python-fu--9136

A possible / probable snag is if you do not have a working python.
This machine i am using is kubuntu 24.04 / Gimp 2.10.38 from a PPA and an appimage launcher from https://github.com/TasMania17/Gimp-Appimages-Made-From-Debs/releases/tag/Gimp-v2.10.38 (It is the whole Gimp but I prefer to keep a regular installation.)
...or the flatpak Gimp also provides python2


RE: Panorama Projection - patrislav - 07-26-2024

Thank you! Do you know if (and how) it's possible to script these GEGL functions from scheme scripts as well?

(I'm way more comfortable in Python than Scheme, but I don't want my script to require an exotic Gimp installation with a obsolete Python version that's EOL since more than four years).


RE: Panorama Projection - rich2005 - 07-26-2024

(07-26-2024, 11:25 AM)patrislav Wrote: Thank you! Do you know if (and how) it's possible to script these GEGL functions from scheme scripts as well?

(I'm way more comfortable in Python than Scheme, but I don't want my script to require an exotic Gimp installation with a obsolete Python version that's EOL since more than four years).

I have not seen a script-fu version. Not to say one does not exist.

see: https://www.gimp-forum.net/Thread-Scripting-GEGL-operations

The gimp_gmic_qt plugin now has a whole section of map projections, maybe one of those is equivalent.


RE: Panorama Projection - patrislav - 07-26-2024

(07-26-2024, 11:34 AM)rich2005 Wrote:
(07-26-2024, 11:25 AM)patrislav Wrote: Thank you! Do you know if (and how) it's possible to script these GEGL functions from scheme scripts as well?

(I'm way more comfortable in Python than Scheme, but I don't want my script to require an exotic Gimp installation with a obsolete Python version that's EOL since more than four years).

I have not seen a script-fu version. Not to say one does not exist.

see: https://www.gimp-forum.net/Thread-Scripting-GEGL-operations

It looks like the script-fu approach requires an additional Python plugin as interface towards GEGL (since the Scheme / script-fu API doesn't provide one).
So if I need Python anyway, I rather write the whole thing in Python Wink

Now I installed the 2.99.18 flatpak (to avoid relying on a obsolete Python version) and figure out how to use the plugin API.
Thanks again!


RE: Panorama Projection - rich2005 - 07-26-2024

Quote:....Now I installed the 2.99.18 flatpak (to avoid relying on a obsolete Python version) and figure out how to use the plugin API.....

You need to speak to Ofnuts ...


RE: Panorama Projection - patrislav - 07-26-2024

ok, the plugin API as such seems to be straightforward - but not the GEGL part of it. I'm supposed to build "chains" from "nodes" and "connect" them in some special way. When I just want to apply a operation to an image. All code examples I can find use "python-fu" but it seems to be deprecated.

Are there some simple examples for just applying a GEGL operation to an image, from a GIMP Python plugin? Using the recent version of GIMP Python API?


RE: Panorama Projection - patrislav - 07-27-2024

(07-26-2024, 04:35 PM)patrislav Wrote: Are there some simple examples for just applying a GEGL operation to an image, from a GIMP Python plugin? Using the recent version of GIMP Python API?

Ok, found it:
https://gitlab.gnome.org/GNOME/gimp/-/blob/master/extensions/goat-exercises/goat-exercise-py3.py#L140

This blog post is also helpful:
https://z-uo.medium.com/create-python3-plugin-for-gimp-the-basics-94ede94e9d1f


RE: Panorama Projection - MrsP-from-C - 07-27-2024

That's GIMP 2.99 stuff !
Won’t work in GIMP 2.10


RE: Panorama Projection - patrislav - 07-27-2024

(07-27-2024, 01:59 PM)MrsP-from-C Wrote: That's GIMP 2.99 stuff !
Won’t work in GIMP 2.10

Yeah, that's why I looked it up (don't want to use obsolete Python version, and/or obsolete GIMP APIs)