Posts: 1,512
Threads: 69
Joined: May 2021
Reputation:
167
Operating system(s):
Gimp version: 2.10
11-10-2021, 03:06 PM
(This post was last modified: 11-10-2021, 03:08 PM by PixLab .)
I'm no python... at all.
I would like to know if we can write something in python using the "Filters/Map/Recursive transform..." tool, if so what would it be like?
Any reference to this tool using python would be wonderful
Posts: 7,132
Threads: 155
Joined: Oct 2016
Reputation:
1,003
Operating system(s):
Gimp version: 2.10
Posts: 1,512
Threads: 69
Joined: May 2021
Reputation:
167
Operating system(s):
Gimp version: 2.10
11-23-2021, 05:37 AM
(This post was last modified: 11-23-2021, 05:41 AM by PixLab .)
(11-10-2021, 06:49 PM) rich2005 Wrote: You could start here: https://www.gimp-forum.net/Thread-Script...operations
and here: http://gimpchat.com/viewtopic.php?f=9&t=18040&start=10
Mostly script-fu but there is some python at the end.
There will also be some code in here: https://www.gimpscripts.net/2021/10/mrq-...s-rpl.html
Sorry for late answer, I forgot that I did post here.
I am searching for something more or less like
Code:
pdb.gimp_layer_recursive_transform(img, layer, parameter 1, 2, 3, 4, 5, and so on)
But I might be completely wrong
anyway thanks a lot Rich
Posts: 7,132
Threads: 155
Joined: Oct 2016
Reputation:
1,003
Operating system(s):
Gimp version: 2.10
11-23-2021, 04:03 PM
(This post was last modified: 11-23-2021, 05:41 PM by rich2005 .)
A couple of plugins that you can look at
First the fu-python-high-pass.py This is the type that you want. It registers in the database as gegl-high-pass with parameters. Too complicated for me to adapt to recursive-transform.
The second gegl-command.py is an example of slotting a gegl function into a plugin written for the purpose.
Find information about the recursive transform variables:
https://gegl.org/operations/gegl-recursi...sform.html
You can get some gegl settings if you export the saved values to a file. Looks like this:
Code:
https://gegl.org/operations/gegl-recursive-transform.html
# GIMP 'Recursive Transform' settings
(time 0)
(transform "matrix(0.99331105831873456,0,0,0,0.95348834991455078,0,4,0,1)")
(first-iteration 3)
(iterations 5)
(fade-color (color-rgba 0 0 0 0))
(fade-opacity 1)
(paste-below no)
(sampler-type linear)
# end of 'Recursive Transform' settings
...and rewritten as a string
Code:
gegl_graph_string="recursive-transform transform='matrix(0.99331105831873456,0,0,0,0.95348834991455078,0,4,0,1)' first-iteration=3 iterations=5 fade-color=rgba(0.0,0.0,0.0,0.10) fade-opacity=1 paste-below=1 sampler-type=linear"
and that goes into the gegl-command.py in line 53 The plugin registers in the tools menu.
Apart from that, I do not know,best of luck
Edit:
Does not work in Windows , such is life, probably needs the Windows GEGL binary installing.
Silly-me, It does work, I was not using a transparent layer.
Attached Files
gegl-examples.zip (Size: 2.95 KB / Downloads: 159)
Posts: 1,512
Threads: 69
Joined: May 2021
Reputation:
167
Operating system(s):
Gimp version: 2.10
(11-23-2021, 04:03 PM) rich2005 Wrote: A couple of plugins that you can look at
First the fu-python-high-pass.py This is the type that you want. It registers in the database as gegl-high-pass with parameters. Too complicated for me to adapt to recursive-transform.
The second gegl-command.py is an example of slotting a gegl function into a plugin written for the purpose.
Find information about the recursive transform variables: https://gegl.org/operations/gegl-recursi...sform.html
You can get some gegl settings if you export the saved values to a file. Looks like this:
Code:
https://gegl.org/operations/gegl-recursive-transform.html
# GIMP 'Recursive Transform' settings
(time 0)
(transform "matrix(0.99331105831873456,0,0,0,0.95348834991455078,0,4,0,1)")
(first-iteration 3)
(iterations 5)
(fade-color (color-rgba 0 0 0 0))
(fade-opacity 1)
(paste-below no)
(sampler-type linear)
# end of 'Recursive Transform' settings
...and rewritten as a string
Code:
gegl_graph_string="recursive-transform transform='matrix(0.99331105831873456,0,0,0,0.95348834991455078,0,4,0,1)' first-iteration=3 iterations=5 fade-color=rgba(0.0,0.0,0.0,0.10) fade-opacity=1 paste-below=1 sampler-type=linear"
and that goes into the gegl-command.py in line 53 The plugin registers in the tools menu.
Apart from that, I do not know,best of luck
Edit: Does not work in Windows , such is life, probably needs the Windows GEGL binary installing.
Silly-me, It does work, I was not using a transparent layer.
Wow, invaluable link and examples!
Thank you so much Rich