Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

Mon Nov 06, 2023 2:37 pm

Where's the man at? Kevin?

Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

Mon Nov 06, 2023 3:15 pm

Image
This is friendlier labels when run from front end or browsing in procedure browser
as it shows default value and min..max right in brackets ie (default: 1, 0..50)

Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

Mon Nov 06, 2023 11:49 pm

I was bored and thought it would be fun to generate some static color 2 gray (c2g)
and let people browse by clicking to get a good feel of what the values do as they change.
You get to see different values at the same time so it's kind'a cool
https://tinmantaken.blogspot.com/2023/1 ... tions.html

Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

Mon Nov 06, 2023 11:53 pm

Tin, see my post on the other thread.

Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

Tue Nov 07, 2023 12:06 am

dinasset wrote:Tin, see my post on the other thread.

It's done here

Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

Tue Nov 07, 2023 4:20 am

Interesting plugins, I love experimenting.

I did find one that locked-up, GEGL tiles. I thought it might be me, so tried again and....

System Warning, running out of space in my home partition (kubuntu 20.04) this is filelight.

gegl.jpg
gegl.jpg (42.5 KiB) Viewed 40002 times


Not a problem, just emptied ~/.cache, as long as you know where to look ;)

Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

Tue Nov 07, 2023 6:33 am

rich,
I tried it tile and it just ate up the image like blank it (completely transparent) out on mine. I am on windows.

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Tue Nov 07, 2023 9:22 am

Tim,
Thank you for the very useful plug-in. In GIMP 2.10, GEGL operations when run from Python can be flakey, so your plug-in will reduce some self doubt and prove to be an excellent research tool for me. :yes

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Tue Nov 07, 2023 10:02 am

vit, do you have the latest 2 files?
as dinasset requested the name change to remove dinasset from the function call so it needs the other gegl_graph.py included with that last zip (download/file.php?id=69700)

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Tue Nov 07, 2023 12:30 pm

Tin, sorry I can't help.

I gave up on this quite soon after starting when I found that there's no way to pass curve arrays into GEGL: https://gitlab.gnome.org/GNOME/gegl/-/issues/264

Kevin

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Tue Nov 07, 2023 12:35 pm

Understandable.
I guess we'll just have to wait for the real source to expose them.

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Tue Nov 07, 2023 2:06 pm

I'm not a Gegl specialist but here's something to consider:

1. Your plugin works on the active layer - you might want to add making a copy of the layer or creating a new image.

2. Gegl plugins can operate in the minimum, maximum range and not only in the ui-minimum, ui-maximum range (but I don't know if this is always the case).


Example-1: Difference of Gaussians (https://gegl.org/operations/gegl-differ ... sians.html), in menu: GEGL-Automated ➤ Gegl to Python: difference-of-gaussians...

Difference of Gaussians
Edge detection with control of edge thickness, based on the difference of two gaussian blurs
Radius 1
name: radius1 type: double default: 1.00 minimum: 0.00 maximum: 1000.00 ui-minimum: 0.00 ui-maximum: 10.00 ui-gamma: 1.50 ui-step-small: 0.01 ui-step-big: 1.00 ui-digits: 3
Radius 2
name: radius2 type: double default: 2.00 minimum: 0.00 maximum: 1000.00 ui-minimum: 0.00 ui-maximum: 20.00 ui-gamma: 1.50 ui-step-small: 0.01 ui-step-big: 1.00 ui-digits: 3


3. Where possible, replace PF_FLOAT with PF_SPINNER.

4. Adding a preview (but for single Gegl operations it doesn't make much sense except registration in PDB)

Example-2:Supernova (how to enable color selection, type parameters: %f, %d, %s), (https://gegl.org/operations/gegl-supernova.html), in menu: GEGL-Automated ➤ Gegl to Python: Supernova...

I deliberately changed the registration and location in the menu so that it does not conflict with your version.

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Tue Nov 07, 2023 2:11 pm

hehehe I don't know anything about GEGL.
Thanks all the info.

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Wed Nov 08, 2023 6:23 am

On Windows 10, the latest version fixed the GEGL cartoon error for me.

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Wed Nov 08, 2023 10:02 am

@vitforlinux,
I don't think it is case-sensitive issue because Python is already case-sensitive.
I think there's a problem with linux version as Kevin only guaranteed that it would work on Windows (for dinasset). and my version just took out the dinasset in the name.
Sorry, I am on windows as well so I don't know what else it could be.
I tried deleting all my files and downloaded the 2 versions (one that opens on command/terminal window briefly when it ran and one that doesn't open command/terminal at all), and they both worked as expected.

if you don't see /Python-Fu/gegl_graph/Do gegl graph menu item then it's a linux thing, which is odd to me because Rich was able to run all the other ones and I think rich is on Linux.

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Thu Nov 09, 2023 9:57 am

Hooray! :D

Re: GEGL operations exposed to Python-Fu - WIP

Sun Nov 12, 2023 12:52 pm

trandoductin wrote:does anyone know if

name: cpn-3-keep type: boolean default: False label:[color-model {rgb} : rgb-label, color-model {hsl} : hsl-label] rgb-label:Keep blue component hsl-label:Keep lightness component

is equivalent to
(PF_OPTION,"cpn-3-keep", "OPTION:", 0, ["Keep blue component","Keep lightness component"]),

Am I even close? boolean? and then a bunch of labels?
or do I have to map rgb and hsl to some other constant numbers?


That command has to do with the slider display name in gegl:alien-map (aka the solarization filter) other then that I don't know how to help here.


Also, if you want to make this useful allow python to call gegl commands with ANY namespace not just gegl:

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Sun Nov 12, 2023 12:57 pm

*author update, this post is partially inaccurate. It can read anything but gimp: namespaces)
This plugin can not benefit me because it only works on (gegl:) name space operations. A custom operation of mine like lb:glossy-balloon (lb:) or gimp:threshold-alpha (gimp:) name space won't work. Gimp's team instructed me to make all new filters of mine use my own name space (lb:) and not (gegl:)

So someone please figure out how to get this to work with my plugins that use alt name spaces.

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Sun Nov 12, 2023 1:07 pm

The only thing that makes GEGL better then traditional methods is the ability to chain operations (a individual filter node) into meta operations (many filters in one node). In example filters like gegl:dropshadow are meta operations built on (gegl:color, gegl:dst-over, gegl-median-blur, gegl:gaussian-blur) chained together, and gaussian blur can even be reductionized to a node called gegl:g-blur.

Calling GEGL filters individually is just like using script fu, it doesn't make munch sense. What you need to be doing is writing gegl syntax, make a custom filter then call it a node. That is what I do with all my filters; chain simple operations to make complex ones. Then call namespace:operation in python, gegl, script fu or whatever to test your new operation

Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Sun Nov 12, 2023 3:13 pm

Sorry it's beyond my capability.
Post a reply