Posts: 6
Threads: 1
Joined: Jun 2024
Reputation:
0
Operating system(s):
Gimp version: 2.10
I tried to run the waves filter from within a scheme script (for being able to do batch processing). My best guess yet was
Code:
(plug-in-waves RUN-NONINTERACTIVE image drawable amplitude phase wavelength 0 FALSE)
Unfortunately this produces different results from when I use the waves filter interactivly (see images below). Also the parameter ranges differ and some parameters are missing completely. Looks like this is some other filter which is also called waves.
Diving into the config files I think interactivly I'm using GimpGegl-gegl-waves, but there is no documentation on that in the procedure browser nor do I know how to call this in scheme.
So my questions:
a) How can I call Filters->Distorts-Waves from within a scheme script?
b) Maybe more important: How could I have found out that myself?
---
Original image:
Using waves interactivly:
Using script:
Im using GIMP 2.10 (from Debian stable).
Posts: 7,133
Threads: 155
Joined: Oct 2016
Reputation:
1,003
Operating system(s):
Gimp version: 2.10
(06-25-2024, 08:03 AM)berni Wrote: I tried to run the waves filter from within a scheme script (for being able to do batch processing). My best guess yet was
Code:
(plug-in-waves RUN-NONINTERACTIVE image drawable amplitude phase wavelength 0 FALSE)
Unfortunately this produces different results from when I use the waves filter interactivly (see images below). Also the parameter ranges differ and some parameters are missing completely. Looks like this is some other filter which is also called waves.
Scheme reads like Sanskrit to me so this is just something that might go a little way to help.
Using Debian ? Is your Gimp 2.10 from their repo (no python) or is it a flatpak ?
You are correct about GEGL. It does say that "waves" is a compatibility "plugin" The GEGL syntax is here: https://gegl.org/operations/gegl-waves.html and you can try it out on an active image using Filters -> Generic -> GEGL graph. Example:
While it is possible to wrap a GEGL command in a script-fu wrapper and probably use it in that batch command. There might be other options.
One is using the batch plugin BIMP, the waves parameters show like this, just the essentials. You might be able to apply to your script-fu command line.
If you are using a flatpak, then there is a BIMP plugin for that, a regular install you might have to compile see: https://github.com/alessandrofrancesconi...lugin-bimp (I have a 'buntu compile, might work with Debian see: https://www.gimp-forum.net/Thread-BIMP-2-2 )
Posts: 6
Threads: 1
Joined: Jun 2024
Reputation:
0
Operating system(s):
Gimp version: 2.10
(06-25-2024, 09:03 AM)rich2005 Wrote: Using Debian ? Is your Gimp 2.10 from their repo (no python) or is it a flatpak ?
Yes, from Debian repo, just apt get gimp.
(06-25-2024, 09:03 AM)rich2005 Wrote: You are correct about GEGL. It does say that "waves" is a compatibility "plugin"
Scripting GEGL seems not to be possible yet, see GEGL issue 6217. - At least, GEGL scripts are not exposed in PDB...
(06-25-2024, 09:03 AM)rich2005 Wrote: One is using the batch plugin BIMP,
I'm aware of BIMP, but I'd prefere to do scripting... (it's a matter of personal style I guess)
Posts: 7,133
Threads: 155
Joined: Oct 2016
Reputation:
1,003
Operating system(s):
Gimp version: 2.10
06-25-2024, 12:34 PM
(This post was last modified: 06-25-2024, 12:54 PM by rich2005.
Edit Reason: typo
)
(06-25-2024, 09:51 AM)berni Wrote: Scripting GEGL seems not to be possible yet, see GEGL issue 6217. - At least, GEGL scripts are not exposed in PDB...
That is correct, you can use a utility script to incorporate the GEGL procedure see: https://www.gimp-forum.net/Thread-Script...operations
Quote:I'm aware of BIMP, but I'd prefere to do scripting... (it's a matter of personal style I guess)
Fair enough, BIMP does give a hint for suitable parameters. As a test
Code:
(define (bareBones img drawable) ;image and layer to work on
; wave
(plug-in-waves 0 img drawable 25 0.3 75 1 0)
(gimp-display-new img)
);end of script procedure
(script-fu-register "bareBones"
"<Image>/Script-Fu/bareBones" ;menu item
"an empty script" ;description
"" ;author
"" ;copyright notice
"" ;date
"*";used on an image
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
)
Posts: 6
Threads: 1
Joined: Jun 2024
Reputation:
0
Operating system(s):
Gimp version: 2.10
06-25-2024, 04:04 PM
(This post was last modified: 06-25-2024, 04:07 PM by berni.)
(06-25-2024, 12:34 PM)rich2005 Wrote: [...] you can use a utility script to incorporate the GEGL [...]
Unfortunately I do not understand the linked thread (maybe a language barrier). For me this sounds like a solution, that did not work (and thus the attachment was removed). The rest of the discussion seems to be about some python programms, but I didn't get the hang of it nor can I find any utiility script.
(06-25-2024, 12:34 PM)rich2005 Wrote: Fair enough, BIMP does give a hint for suitable parameters. As a test [...]
I saw these parameters in your post from above, but on my end this doesn't work. I get the following error message:
Code:
GIMP-Error: Calling error for procedure 'plug-in-waves':
Procedure 'plug-in-waves' has been called with value '75.000000' for argument 'wavelength' (#6, type gdouble). This value is out of range.
This is consistent with the values given in PDB, see screenshot below. For me it looks like there must be two different versions of that plugin around...
PS: No language barrier. I was just too stupid to realise that the thread continuos on a second page...
Posts: 7,133
Threads: 155
Joined: Oct 2016
Reputation:
1,003
Operating system(s):
Gimp version: 2.10
06-25-2024, 04:31 PM
(This post was last modified: 06-25-2024, 05:05 PM by rich2005.)
I was just pointing out that GEGL filters can be used. I think you will need python but that is not there with a regular Gimp 2.10 from Debian.
Did you copy that script code In the earlier post ? Maybe save as test.scm. Put that in your scripts folder.
It is up in the menu as Script-Fu -> barebones Apply as test
Just done that on a different computer and as example
Quote:So my questions:
a) How can I call Filters->Distorts-Waves from within a scheme script?
Does that answer that question.
Quote:b) Maybe more important: How could I have found out that myself?
That is the syntax shown in the procedure browser. Edit: One way is look at other peoples code.
Edit: Which is different to my Gimp 2.10.38 I wonder why ?
Posts: 6
Threads: 1
Joined: Jun 2024
Reputation:
0
Operating system(s):
Gimp version: 2.10
(06-25-2024, 04:31 PM)rich2005 Wrote: I was just pointing out that GEGL filters can be used. I think you will need python but that is not there with a regular Gimp 2.10 from Debian.
Sounds like a long road... Anyway thanks for pointing this out.
Quote:Did you copy that script code In the earlier post ? Maybe save as test.scm. Put that in your scripts folder.
No. But it's pretty much like the code I wrote (and scheme isn't greek to me ), with the difference that my code can be called from command line. Anyway, now I did. The result is the same:
(06-25-2024, 04:31 PM)rich2005 Wrote: Quote:So my questions:
a) How can I call Filters->Distorts-Waves from within a scheme script?
Does that answer that question.
This is hard to answer. For me it looks like it can be called, but only with limited values for wavelength (0.1 to 50 oder 0.1 to 100) compered to Waves (which calls wavelength period and has a range of values from 0.1 to 1000) and without giving the position of the center point (which I only note for completeness, I do not need to change that). I wasn't able yet to find the source code of plug-in-waves. It might be possible to remove the restriction there.
(06-25-2024, 04:31 PM)rich2005 Wrote: Edit: Which is different to my Gimp 2.10.38 I wonder why ?
I'm using Gimp 2.10.34. Maybe that's the reason?
Posts: 6,340
Threads: 272
Joined: Oct 2016
Reputation:
563
Operating system(s):
Gimp version: 2.10
(06-25-2024, 05:17 PM)berni Wrote: (06-25-2024, 04:31 PM)rich2005 Wrote: I was just pointing out that GEGL filters can be used. I think you will need python but that is not there with a regular Gimp 2.10 from Debian.
Sounds like a long road... Anyway thanks for pointing this out.
Quote:Did you copy that script code In the earlier post ? Maybe save as test.scm. Put that in your scripts folder.
No. But it's pretty much like the code I wrote (and scheme isn't greek to me ), with the difference that my code can be called from command line. Anyway, now I did. The result is the same:
(06-25-2024, 04:31 PM)rich2005 Wrote: Quote:So my questions:
a) How can I call Filters->Distorts-Waves from within a scheme script?
Does that answer that question.
This is hard to answer. For me it looks like it can be called, but only with limited values for wavelength (0.1 to 50 oder 0.1 to 100) compered to Waves (which calls wavelength period and has a range of values from 0.1 to 1000) and without giving the position of the center point (which I only note for completeness, I do not need to change that). I wasn't able yet to find the source code of plug-in-waves. It might be possible to remove the restriction there.
(06-25-2024, 04:31 PM)rich2005 Wrote: Edit: Which is different to my Gimp 2.10.38 I wonder why ?
I'm using Gimp 2.10.34. Maybe that's the reason?
Se the doc for the aloowed values ( Browse... button in the script-fu console).
Posts: 6
Threads: 1
Joined: Jun 2024
Reputation:
0
Operating system(s):
Gimp version: 2.10
(06-25-2024, 05:22 PM)Ofnuts Wrote: Se the doc for the aloowed values (Browse... button in the script-fu console).
Yes, I know that. But it's only 0.1 to 50 while Filters->Distorts->Waves allows values up to 1000 and I need values around 300...
Posts: 7,133
Threads: 155
Joined: Oct 2016
Reputation:
1,003
Operating system(s):
Gimp version: 2.10
06-25-2024, 06:14 PM
(This post was last modified: 06-25-2024, 06:15 PM by rich2005.)
Back to no.1 computer First a bit of history: This is Gimp 2.8 where waves is an actual binary plugin which you find in /usr/lib/gimp/2.0/plug-ins/
And you can see where those Gimp 2.10 values come from. I did look and an older Gimp 2.10 (appimage) and wavelength is 0.1 to 50 not 0.1 to 100 as with latest Gimp. The devs must have tinkered with it sometime. The problem with that is it is a GEGL compatibility plugin and does not exist as a separate binary plugin.
-----------
If you want to use the GEGL parameters 0 to 1000 then you might have to abandon scheme and see if you can get python 2 and gimp-python working. Maybe using a flatpak or an appimage version.
This using a utility plugin and GEGL values for waves.
|