Switch to full style
Ask all general Gimp related questions here
Post a reply

[Um, no]Can a motivated user edit Python2 plug-ins to work in Py3?

Wed Nov 30, 2022 9:46 am

GIMP Version: 2.10.30
Operating System: Linux
OS Version: Ubuntu 22.04 LTS
GIMP Experience: Experienced User

List any relevant plug-ins or scripts:
all (^;



I debated whether this should go here or in Scripts-and-Plugins, but decided that even if the answer is:
"Oh, blazes, NO!"
there may be others wondering if there is any GIMP Help for accomplishing it.
[I did find this mention of the topic, but I am interested in learning What Specific Steps would be required, in the general case.]

Elsewhere I reported hoisting myself upon my own petard, again.

@rich2005 pointed out that, in addition to a flatpak, user @Tas_mania has addressed the problem by publishing a GIMP-version-that-will-work. And, I will go that route.

However, it is obvious--to someone as blind as myself--that, ultimately, all Python2 plug-ins will have to be modified to work with Python3, because GIMP 3.0 will use that version.

Q. If that is not wrong, then could ordinary, but motivated, users "somehow" learn to modify existing Python scripts to work under Python3--and presumably offer the variants to others?

(I have an uncomfortable feeling that I am going to be--rightfully--flamed for this... I have next-to-no-feeling in my backside anyway from "prior encounters with dragons.")

Re: Can a motivated user edit Python2 plug-ins to work in Python3?

Wed Nov 30, 2022 11:27 am

vitforlinux wrote:I've been waiting a long time to see a Python 2 plugin ported to Python 3 on Gimp 2.99 to figure out how it's done and venture into editing.


How about the foggify plugin ;)

https://gitlab.gnome.org/GNOME/gimp/-/b ... foggify.py

Re: Can a motivated user edit Python2 plug-ins to work in Python3?

Wed Nov 30, 2022 11:33 am

@vitforlinux
When I first read/redd:
But it's not clear and it's in Italian

my immediate thought was, "I think I see the problem: it's in Italian." and then I laughed at myself.

As for your English, au contraire, you have nearly mastered a second language that I increasingly struggle with myself.

Thanks for your quick commentary.

Cheers!

Re: Can a motivated user edit Python2 plug-ins to work in Python3?

Wed Nov 30, 2022 11:40 am

rich2005 wrote:
vitforlinux wrote:I've been waiting a long time to see a Python 2 plugin ported to Python 3 on Gimp 2.99 to figure out how it's done and venture into editing.


How about the foggify plugin ;)

https://gitlab.gnome.org/GNOME/gimp/-/b ... foggify.py


Thanks. I see there some number of Python3 scripts already available. (I wonder that possibly you picked 'foggify' for a double-entendre, but would benefit from a pointer to the Python2 version for a side-by-side, which is what @vitforlinux was after I think.)

Re: Can a motivated user edit Python2 plug-ins to work in Python3?

Wed Nov 30, 2022 11:57 am

gramp wrote:...snip benefit from a pointer to the Python2 version for a side-by-side ...


It is a regular Gimp 2.10 plugin. Filters -> Decor -> Fog For linux, you would typically find it in /usr/lib/gimp/2.0/plug-ins/foggify/

When it comes to re-writing python plugins, I seem to recall Ofnuts recently commenting that the Gimp 3 api was still too fluid to make conversions worth while.

The Italian, I follow most of it. My usual installation is kubuntu 20.04 and I used old packages to add gimp-python, a similar procedure. Unfortunately these do not work with a kubuntu 22.04
Getting Gimp 2.10.32 from the Panda Jim PPA and using the appimage launcher is an easy way out.

Re: Can a motivated user edit Python2 plug-ins to work in Python3?

Wed Nov 30, 2022 12:29 pm

Searching "Panda Jim PPA" brought back:
https://launchpad.net/~ubuntuhandbook1/ ... ex?memo=75

and I recognize Launchpad as a "place for PPAs".

It has instructions for fetching and installing Panda Jim's offering(s).

Thanks, Rich.

You'd recommended Tas_mania's appimage too back in August.

Re: Can a motivated user edit Python2 plug-ins to work in Python3?

Wed Nov 30, 2022 5:06 pm

Many of the python stuff for text styling can be replaced by my GEGL filters. I hope someone ports OfNuts plugins to Gimp 3 as I find some of them very useful.

Re: Can a motivated user edit Python2 plug-ins to work in Python3?

Thu Dec 01, 2022 3:12 am

First let the new GIMP3 API be stable enough, so it's worth the effort.
My2c

Re: Can a motivated user edit Python2 plug-ins to work in Python3?

Sun Dec 04, 2022 7:59 pm

I just found this, a developer's summary of advance prep work to ease the "Resynthesizer" plug-in's transition to GIMP3:
https://github.com/bootchk/resynthesize ... -version-3

Scanning it, I determine: "MOTIVATION--is not enough."

This one excerpt clinched it for me:
"GimpFu will not be supported by the GIMP organization starting with GIMP version 3. Instead, plugins will need to be written or modified to use GObject introspection."

"GObject."
"Introspection."

Those seem to eliminate casual, even although "Motivated!", users.

My answer to My question is thus: "No."

Re: Can a motivated user edit Python2 plug-ins to work in Python3?

Mon Dec 05, 2022 3:28 am

gramp wrote:I just found this, a developer's summary of advance prep work to ease the "Resynthesizer" plug-in's transition to GIMP3:
https://github.com/bootchk/resynthesize ... -version-3

Scanning it, I determine: "MOTIVATION--is not enough."

This one excerpt clinched it for me:
"GimpFu will not be supported by the GIMP organization starting with GIMP version 3. Instead, plugins will need to be written or modified to use GObject introspection."

"GObject."
"Introspection."

Those seem to eliminate casual, even although "Motivated!", users.

My answer to My question is thus: "No."


Big words, but nothing terrible. This just means that *any* language that has an API to Glib can "discover" the GIMP API calls. In practice most of these calls are a carbon copy of the original interface. I ported a couple of Python scripts to v3, and although a few things came to a stop because some functionality was still missing, use of the API was fairly easy (in fact, somewhat easier than in v2.10).

There are other things to learn/discover and there are currently not many people who know this stuff and have the time to explain it, so this going to be an uphill battle for "casual" programmers for the time being.

Re: [Um, no]Can a motivated user edit Python2 plug-ins to work in Pyth

Mon Dec 05, 2022 6:54 am

Hello! :)

I hope this thread helps.
Post a reply