GIMP Chat
http://gimpchat.com/

GEGL operations exposed to Python-Fu - WIP 72 ops wrapped
http://gimpchat.com/viewtopic.php?f=9&t=20613
Page 1 of 5

Author:  trandoductin [ Mon Nov 06, 2023 2:37 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

Where's the man at? Kevin?

Author:  trandoductin [ Mon Nov 06, 2023 3:15 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

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)

Attachments:
File comment: Friendlier labels for easier values default & range
gegl-python-fu (3).zip [7.24 KiB]
Downloaded 134 times

Author:  trandoductin [ Mon Nov 06, 2023 11:49 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

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

Author:  dinasset [ Mon Nov 06, 2023 11:53 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

Tin, see my post on the other thread.

Author:  trandoductin [ Tue Nov 07, 2023 12:06 am ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

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

It's done here

Attachments:
File comment: suppresses or not show console version (after this [url=http://gimpchat.com/viewtopic.php?f=9&t=18040&p=284967#p284966]finding[/url])
gegl-python-fu & gegl_graph (2).zip [8.67 KiB]
Downloaded 171 times
File comment: 2 in one that doesn't use dinasset naming
gegl-python-fu & gegl_graph.zip [8.66 KiB]
Downloaded 123 times

Author:  rich2005 [ Tue Nov 07, 2023 4:20 am ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

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.

Attachment:
gegl.jpg
gegl.jpg [ 42.5 KiB | Viewed 40003 times ]


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

Author:  trandoductin [ Tue Nov 07, 2023 6:33 am ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 exposed

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

Author:  gasMask [ Tue Nov 07, 2023 9:22 am ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

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

Author:  trandoductin [ Tue Nov 07, 2023 10:02 am ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

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)

Author:  paynekj [ Tue Nov 07, 2023 12:30 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

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

Author:  trandoductin [ Tue Nov 07, 2023 12:35 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

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

Author:  MareroQ [ Tue Nov 07, 2023 2:06 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

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.

Attachments:
Example 1.jpg
Example 1.jpg [ 112.17 KiB | Viewed 6501 times ]
Example 2.jpg
Example 2.jpg [ 128.05 KiB | Viewed 6501 times ]
gegl_to_python.zip [9.35 KiB]
Downloaded 78 times

Author:  trandoductin [ Tue Nov 07, 2023 2:11 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

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

Author:  gasMask [ Wed Nov 08, 2023 6:23 am ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

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

Author:  trandoductin [ Wed Nov 08, 2023 10:02 am ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

@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.

Author:  trandoductin [ Thu Nov 09, 2023 9:57 am ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Hooray! :D

Author:  contrast_ [ Sun Nov 12, 2023 12:52 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP

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:

Author:  contrast_ [ Sun Nov 12, 2023 12:57 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

*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.

Author:  contrast_ [ Sun Nov 12, 2023 1:07 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

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

Author:  trandoductin [ Sun Nov 12, 2023 3:13 pm ]
Post subject:  Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped

Sorry it's beyond my capability.

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