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

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

Mon Nov 13, 2023 3:04 pm

trandoductin wrote:Sorry it's beyond my capability.


Thanks anyway for advancing GEGL. Eventually someone will figure out how to allow python to read non (gegl:) namespaces.
Once that happens I'm sure it will all work out.

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

Tue Nov 14, 2023 10:44 am

Eventually, hopefully.

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

Tue Nov 14, 2023 4:47 pm

Update, I was partially wrong about something and owe an apology + I have 24 plugins of mine in a zip (with binaries) that I'd kindly request to be converted to python_commands.

WHAT I WAS WRONG ABOUT: ( it turns out gegl_command.py) can use my lb:namespace operations
WHAT I WAS RIGHT ABOUT: (it still can't use (gimp: or svg:) name space operations)

So here is an example of why my plugins would not work with GEGL_command.py originally.

2023-11-14_11-20.png
2023-11-14_11-20.png (40.19 KiB) Viewed 6795 times


gegl_command_crash.png
gegl_command_crash.png (120.22 KiB) Viewed 6795 times


Download here
(its 8mb because it contains pics of the plugins)
https://cdn.discordapp.com/attachments/ ... 14771b7e1&

Attached is a zip folder with code, and binaries for Windows and Linux of 21 plugins of mine and 3 special forks hidden from Gimp's GUI that are compatible with gegl command.py. Every other plugin of mine so far will NOT work with gegl_command.py. Originally only 9 plugins of mine worked with gegl:command-py now 24 of them do and my Github will soon update to fix that.

Listed below are the operation names

lb:clouds
gegl:starfield ( DOES NOT USE LB UNTIL GIMP 3 )
lb:antique
lb:align
lb:polygons
lb:bokeh
lb:electricity (now uses lb:)
lb:aura (now uses lb:)
lb:pencil (now uses lb)
gegl:edge-extract ( DOES NOT USE LB UNTIL GIMP 3 )
lb:video-degradation-mod
lb:innerglow
gegl:long-shadow-pd
lb:action-lines
lb:colorizeluminance
lb:fog
lb:neon-border
lb:sand-text
lb:starburst
lb:doubleglow
lb:shadow
lb:script-glossy-balloon
lb:script-custom-bevel
lb:script-metallic


*UPDATE I ATTACHED INNER GLOWS UPDATED WINDOWS BINARY (lb:innerglow) THAT I FORGOT IN THE MAIN ZIP

Please someone if you don't mind convert these 24 plugins of mine into Python FU Compatible commands.

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

Tue Nov 14, 2023 8:16 pm

I have updated all 21 said repositories with newer binaries that are compatible with gegl_command.py. However my main Github and Discord plugin download page is still outdated with versions that do NOT work with GEGL_Command.py.

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

Tue Nov 14, 2023 8:25 pm

Based on new evidence it is most accurate to say that GEGL_Command.py only works if GEGL .c files have no left over content. I have a habit of leaving scrapped content from early development in my .c files. The scrapped content are GEGL nodes or GUI options that are not in use.

This is the primary thing that was causing my plugins not to work in GEGL_Command.py, but for some reason it works in GEGL just fine.

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

Tue Nov 14, 2023 8:59 pm

https://github.com/LinuxBeaver/Special_ ... le_plugins


I made a repo on Github of all (currently 24) plugins of mine that work with gegl_command.py and soon I will update mroe

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

Wed Nov 15, 2023 12:02 pm

I just released a special version of my lb:sharp-bevel filter that is compatible with python scripting lb:script-sharpbevel
and it is in the Github download here. This makes 24/70 plugins of mine compatible with Python scripting. I am still waiting to see if someone will convert them to python fu.

https://github.com/LinuxBeaver/Special_ ... le_plugins


Image

Image

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

Sun Nov 19, 2023 2:03 pm

Changes in Ver.2:

- combined into one file gegl-python-fu.py and gegl-graph.py to gegl-python-fu & gegl-graph.py (standalone files: gegl-python-fu.py and gegl-graph.py must be deleted),
- change menu location (You can change it very quickly as you want using Notepad++),
- removed gegl-tile (because it doesn't work), gegl-nop (No operation),
- added: bump-map, component_extract, dropshadow, embos, mosaic, supernova.
- added: "Additional Information"
Image

A little about bump-map:

- bump-map: https://gegl.org/operations/gegl-bump-map.html
- about GEGL graph by Kevin and Tmanni: https://www.gimp-forum.net/Thread-GEGL- ... 0#pid19960. This was crucial to solving the aux problem - save aux.
- chanche offset: '+' up/right, '-' down/left
- gegl_graph_string + aux does not accept commas (that was problem number 2 but I don't know why at all),

I think that the save method (assuming that the 'd:' drive exists) will allow the conversion of filters from 2 pads: aux2 aux.
Tim wrote about 3 pads - which filter is it?

Edit:
Version 2.0 has been removed due to detected bugs
Reported bugs have been fixed in version 2.1 #55

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

Mon Nov 20, 2023 1:10 am

Please check gegl-mosaic.
It doesn't apply correctly parameters: neatness (and type)
choosing type=SQUARE and varying NEATNESS I get
- same result with any valuye of NEATNESS from 0.00 to 0.99 (first attachment)
- total neatness with value 1.00 but changing square to hexagon (second attachment)

avinash-kumar-pdGd5N5J7UM-unsplash GEGL MOSAIC tile=SQUARE neat=0.99.jpg
avinash-kumar-pdGd5N5J7UM-unsplash GEGL MOSAIC tile=SQUARE neat=0.99.jpg (1.25 MiB) Viewed 7016 times

avinash-kumar-pdGd5N5J7UM-unsplash GEGL MOSAIC tile=SQUARE neat=1.00.jpg
avinash-kumar-pdGd5N5J7UM-unsplash GEGL MOSAIC tile=SQUARE neat=1.00.jpg (1.14 MiB) Viewed 7016 times


Thanks

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

Mon Nov 20, 2023 3:10 am

Just a note.
I went to the filter definition.
Could the problem be the use of "-" instead of "_" in some parameters?
I didn't change to try. But you could.
Post a reply