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 4 of 5 |
Author: | contrast_ [ Tue Nov 21, 2023 1:05 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
MareroQ wrote: 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 I see you removed gegl:nop, Its okay to remove it from the GUI (where the user sees stuff) but that operation (gegl:nop) is critical to make connnections in GEGL known as id and ref. Many plugins of mine depend on gegl:nop to do this. To put things simple gegl:nop exist to put filters inside blend modes while calling a copy of the original image. |
Author: | nelo [ Tue Nov 21, 2023 4:56 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
MareroQ wrote: I'm looking for a Bump-map tester on Linux (included in version 2.1) - my Ubuntu doesn't work (temporarily?) after updating. Bumpmap doesn't work on my Linux Mint 20.1 The message I get is this: Code: Select all Traceback (most recent call last): Looks like it wants to write to /usr where it has no permisssions. A user's home dir would be /home/username in Linux |
Author: | MareroQ [ Tue Nov 21, 2023 5:48 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
Hello Contrast Plugin gegl-python-fu & gegl_graph.py is a helper for people writing plugins or scripts, and I don't see any way to use gegl:nop outside of Gegl proper. Single Gegl plugins are registered in the PDB and this is very good, but if you only want to use one operation, it is better to use GEGL directly (advantage in preview). Practically, gegl-python-fu & gegl_graph.py does not need to be registered in the Gimp menu at all (only in the PDB). I assume plugin developers have knowledge of how to use gegl-python. What do you think about not registering gegl-python-fu in menus (except gegl-graph)??? Hello Nelo. Thank you for trying the plugin. The idea behind this game is to temporarily save the Aux image in a location that will be publicly available to users of different versions of Linux. Could you try with the tmp folder (replace "/usr/image_1.png" twice with "/tmp/image_1.png") |
Author: | rich2005 [ Tue Nov 21, 2023 6:49 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
I am probably missing something in the discussion but it works ok here: kubuntu 20.04 / Gimp 2.10.36 (from PPA) Attachment: bump.jpg [ 85.71 KiB | Viewed 15523 times ] Lots of output in a terminal but no error messages |
Author: | nelo [ Tue Nov 21, 2023 8:57 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
Quote: Could you try with the tmp folder (replace "/usr/image_1.png" twice with "/tmp/image_1.png") Yes, that works |
Author: | MareroQ [ Wed Nov 22, 2023 12:49 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
Thank you very much Nelo and Rich2005 for testing. We can always rely on you. ![]() |
Author: | contrast_ [ Wed Nov 22, 2023 11:03 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
I tried adding a special version of my glossy balloon plugin designated for python all by myself and the .py file failed to load. This is what I put Code: Select all #-------------------------------------Beaver----------------------------------------------------- What did I do wrong? Here are the parameters of the filter I cited. https://github.com/LinuxBeaver/Special_ ... ipt-only.c THIS DOES NOT WORK The plan should be to make the 24 compatible plugins of mine a separate python file that ships on said Github page of mine. I'll do it myself (all 24 of them) if someone teaches me how to get my plugins in python correctly. |
Author: | MareroQ [ Wed Nov 22, 2023 1:38 pm ] | ||
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped | ||
@Beaver. If you add a comma (missing) after the line: Code: Select all (PF_FLOAT, "lightness","lightness (default:-7, -15.0..15.0):", -7) everything works (but why without PF_COLOR?)
|
Author: | contrast_ [ Wed Nov 22, 2023 5:24 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
Thank you Mr.Q I got it working and I plan to port my 24 plugins to python all by myself. But should I have them as my own .c file called geglplugins.py, but if so they'd still need to be in your menu. I could have parenthesis with (plugin) after them. |
Author: | contrast_ [ Wed Nov 22, 2023 5:29 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
MareroQ wrote: @Beaver. If you add a comma (missing) after the line: Code: Select all (PF_FLOAT, "lightness","lightness (default:-7, -15.0..15.0):", -7) everything works (but why without PF_COLOR?) The script version of glossy balloon only has a hue rotation. (-180 - 180) from gegl:hue-chroma. The color node in the modern version of Glossy Balloon uses gimp:layer-mode layer-mode=hsl-color and that node does not work in gegl_command.py |
Author: | contrast_ [ Wed Nov 22, 2023 8:47 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
This code causes the python script to not show up at all in Gimp. What did I do wrong? Corresponds too https://github.com/LinuxBeaver/Special_ ... t_cbevel.c I used PF_OPTION for the drop down list of blend modes and intentionally excluded some options. Code: Select all def gegl_custom_bevel(image, layer, opacity,blendmode,azimuth,elevation,depth,size,alphapercentile,gaus,box,mcb): |
Author: | contrast_ [ Wed Nov 22, 2023 9:47 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
I got custom bevel working but every blend mode I choose is exactly the same. how do I get it to switch blend modes ![]() CODE HERE Code: Select all def gegl_custom_bevel(image, layer, opacity,blendmode,azimuth,elevation,depth,size,alphapercentile,gaus,box,mcb): |
Author: | contrast_ [ Wed Nov 22, 2023 9:49 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
Also things like mcb and gaus are technical property names. I want to rename them to "internal gaussian blur" and "smooth". I think I know how to do that so I'll attempt to rename some things. |
Author: | trandoductin [ Wed Nov 22, 2023 9:52 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
you're setting type. don't know for sure but shouldn't you pass in like this as string for blendmode and pass in type Code: Select all gegl_graph_string="lb:script-custom-bevel opacity=%f blendmode=%s azimuth=%f elevation=%f depth=%f size=%f alphapercentile=%f gaus=%f box=%f mcb=%f" % (opacity, type, azimuth, elevation, depth, size, alphapercentile, gaus, box, mcb) |
Author: | contrast_ [ Wed Nov 22, 2023 10:59 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
ok, I will change blend mode to %s instead of =%f. I also changed "type" to "blendmode" because custom bevel has no "type" property but it does have a "blendmode" property. Now lets see if it works |
Author: | contrast_ [ Wed Nov 22, 2023 11:06 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
I don't know how to solve this but here is the code. It works but the blend mode switcher is broke Code: Select all def gegl_custom_bevel(image, layer, opacity, blend_mode,azimuth,elevation,depth,size,alphapercentile,gaus,box,mcb): |
Author: | trandoductin [ Wed Nov 22, 2023 11:20 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
I don't think it's broken but if you're setting now blendmode without underscore, you should pass that in as Code: Select all gegl_graph_string="lb:script-custom-bevel opacity=%f blendmode=%s azimuth=%f elevation=%f depth=%f size=%f alphapercentile=%f gaus=%f box=%f mcb=%f" % (opacity, blendmode, azimuth, elevation, depth, size, alphapercentile, gaus, box, mcb) unless you're trying to pass the number in for blendmode, otherwise you want the string blendmode in the (opacity, blendmode ....) and not (opacity,blend_mode...) that's why i put it as type before because you're trying to pass the variable you set with switch so I assume you're trying to pass that into the string so that after it formats it you get opacity=%f with %f replace with opacity float variable. and blendmode=%s with %s replaced with type string variable. you can always pdb.gimp_message(gegl_graph_string) to debug it. it's just setting a string for example Code: Select all mystring = "My age is %f and my name is %s" % (10,"Tin") pdb.gimp_message(mystring) will show My age is 10 and my name is Tin |
Author: | trandoductin [ Wed Nov 22, 2023 11:30 pm ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
also is the string supposed to be "blendmode=%s" or "blend_mode=%s" |
Author: | contrast_ [ Thu Nov 23, 2023 12:31 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
ok, I got it. This works. Thanks Code: Select all def gegl_custom_bevel(image, layer, opacity, blendmode, azimuth, elevation, depth, size, alphapercentile, gaus, box, mcb): |
Author: | contrast_ [ Thu Nov 23, 2023 12:37 am ] |
Post subject: | Re: GEGL operations exposed to Python-Fu - WIP 72 ops wrapped |
btw, I could make a special version of the emboss filter that uses blend modes other then the default "multiply" that way you guys can have easier access to good bevel algorithms without having to learn how GEGL composers work. id=1 blendmodehere aux=[ ref=1 emboss elevation= depth= azimuth= ] |
Page 4 of 5 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |