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 [ Sun Nov 05, 2023 9:40 pm ] |
Post subject: | GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
1. Since paynekj allowed dinasset to call GEGL functions with the zip found here: viewtopic.php?f=9&t=18040&p=254914#p255005 2. I thought I would try and parse all functions descriptions found on https://www.gegl.org/operations 3. Turn them into (wrapper) Python-Fu functions which will use the commented out python_fu_dinasset_gegl_graph (found in point 1) It's an idea, not sure if I can do it I am only 65% sure, but this post is here to show progress. EDIT ------ 72 out of 256 code sections generated (0.28%) have been exposed. Jump to get py files to work with these 72 |
Author: | trandoductin [ Sun Nov 05, 2023 9:53 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP |
What I am unsure about is the the pads. Sometimes it's input output for example gegl:c2g but it's more like for gegl:displace pads: aux2 aux input output I have no clue how to deal with that. |
Author: | trandoductin [ Sun Nov 05, 2023 10:17 pm ] | ||
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP | ||
ok so I parsed and think I have these info which will be needed to construct the automated Python-Fu generation. sample of a few of them at the start. (The result1.txt attached has all of them) Code: Select all ===== post #6 has code that turns the attached below file into python fu procedures that can call gegl ops
|
Author: | trandoductin [ Sun Nov 05, 2023 10:30 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP |
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? |
Author: | trandoductin [ Mon Nov 06, 2023 7:08 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP |
oh here's the code i used to get above result1.txt which downloads from gegl operations and do some simple parsing and formating just a standalone python script (not plug-in). Code: Select all import requests |
Author: | trandoductin [ Mon Nov 06, 2023 11:09 am ] | |||
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP | |||
I think I made pretty good progress (other than funky ones that has "pads" which are more than 2) The below code generates code from result1.txt (mentioned in post post #3) Code: Select all typelines = set() attached file is the generated py code to expose gegl functions. There are right now 72 exposed. If I learn more in the future about how to map params and deal with other "pads" I'll add changes to above code to generate more. When I generated all of them an put gimp messages to say "Not Yet Implemented" I ran into an issue when the file is too large GIMP wouldn't load so I had to break it into 2 files about 3000 lines each then GIMP was happy with it (I don't know what the real limit is though). But yeah this one is small enough to have in one file that exposes all 72 functions basically any functions that uses "string","int","double","boolean" and has pads 2 or less pads. Oh yeah you have to look at the first post and uncomment dinnaset register call (that's currently being commented out) because this uses that. See friendlier labelled version (of gegl-python-fu.zip)
|
Author: | trandoductin [ Mon Nov 06, 2023 11:17 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP |
LOTS HAVE BEEN EXPOSED currently 72 functions (files in previous post). I tried the bloom and something happened/changed result so I guess that's good. ![]() |
Author: | trandoductin [ Mon Nov 06, 2023 11:37 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 exposed |
I am on Windows so I don't know Linux peeps can use this or not paynekj is the real hero here exposing the ability to call gegl with string to dinasset. Now I am hoping paynekj knows how to or can instruct me on how to call functions that have more than 2 pads (mentioned in gegl operations descriptions). and/or and how to deal with other variable types as well (other than "int","double","string","boolean"). |
Author: | trandoductin [ Mon Nov 06, 2023 11:56 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 exposed |
Love to hear back from people who successfully uses these front-end or from python-fu. |
Author: | trandoductin [ Mon Nov 06, 2023 2:36 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 exposed |
Test running lines of code from python-fu like this and it worked Code: Select all pdb.python_fu_gegl_bloom(image,layer,50,25,10,50,1) the effect will be applied on layer or selection of layer (if there is selection present). |
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 | ||
![]() 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)
|
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
|
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 [ 42.5 KiB | Viewed 39995 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. ![]() |
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 |
Page 1 of 5 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |