Where does one go to find command line doc for filter parameters

The G’MIC page at https://gmic.eu/gallery/ provides example images for the various filters, artistic for example, along with the G’MIC CLI command that produced the image. Try as I might, including “gmic help” I haven’t been able to find documentation on what any of the parameters mean - the result being that the parameters are just meaningless strings of numbers.

I did find the page at https://gmic.eu/tutorial/command-guide.shtml which has links to what looks like could have been the documentation but none of the links (all of which lead to pages on particularart.com) work.

I also note that there is not a 1:1 relationship between the filters identified on the gallery page and the filters in the G’MIC GIMP plugin. For example, following is the command from the gallery page for running the sketchbw filter:

gmic tiger.png +sketchbw 1 reverse blur[-1] 3 blend[-2,-1] overlay

but here is the parameter string that is output to the GMIC log when the filter is run from GIMP:

fx_sketchbw 3,45,180,30,1.75,0.02,0.5,0.75,0.1,0.7,3,6,0,1,4,0,50,50

I do note that the above parm list does mostly match up with the filter’s dialog in GIMP but not perfectly. And the two versions of the command appear to have nothing in common.

Any help on locating a source clarifying/documenting the meaning of the command line parameters would be greatly appreciated.

Thanks.

1 Like

These are among the reasons why I dove into G’MIC scripting. Although I wish I didn’t have to, I usually read the source *.gmic to find out what the filters are all about:

Primary source of doc for available commands is the G’MIC technical reference:
https://gmic.eu/reference.shtml

This does not include the commands used by the plug-in, as these commands are not “stable” over time (a filter in the plug-in can be updated from time to time, with new features for instance).

The easiest way is to start up Gimp from a terminal. Set GMIC’s preferences to “very verbose (console)” in the preferences - see my screenshot below. You can then switch back and forth and preview a GMIC result on-screen until you like it after which you can copy the exact command that it represents.
gmic-output-console

Here the output from the Freaky Details filter followed by Felt Pen:

Oh, yes, before I forget. I then use the command learnt by using the above technique to create some scripts with particular settings which I’ve come to apply for specific filters so that I can apply GMIC filters in batch without having to start Gimp and processing individual files one by one.

#!/bin/bash
let "nbfiles = $#"
ref=$(kdialog --title "Feltpen" --progressbar "(Initialising ...)" 15)
qdbus $ref Set org.kde.kdialog.ProgressDialog maximum $nbfiles
compteur=0
for i in "$@";do
	if [ -f "$i" ];then
            let "compteur +=1"
            FILE="$i"
	fi
    FILE_NO_EXT=${i%.*}
    echo $i
    echo $local
    gmic -i $i -fx_feltpen 300,50,1,0.1,20,5,0 -o $FILE_NO_EXT-feltpen.jpg
    qdbus $ref setLabelText "Feltpen: image created: `basename "$FILE"` ($compteur of $nbfiles files)"
    qdbus $ref Set org.kde.kdialog.ProgressDialog value $compteur
done
qdbus $ref close

Hi David,
I’ve already been through the technical reference. I could find none of the commands listed on the GMIC gallery pages documented there. If you could provide a pointer to, for example, the doc specific to the sketchbw command I referenced that’d be great.

https://gmic.eu/reference.shtml#sketchbw

The doc is minimal but at least there is the arguments listed :slight_smile:

Hi Mike,
That is exactly how I got the info I outlined in my original question. But that leaves unanswered the question of why the example command given on the GMIC gallery page is totally different than the command log output generated by the plugin version of the command. There is no commonality in the two parameter strings.

This also implies that there is no documentation for these commands and that if you want to find out how they work then you must install GIMP along with the GMIC plugin and run the commands one at a time. Ouch.

Hi David,
Oops. A bad choice on my part to use that as an example without first checking.
Going through the list of artistic filters in the GIMP plugin, following is a list of the filters A-D and whether or not doc exists in reference.shtml:
No Anguish
No Aurora
No Black Crayon Graffiti
No Blockism
No Bokeh
Yes Brushify
Yes Cartoon
No Chalk It Up
No Circle Abstraction
No Color Abstraction Paint
No Colored Pencils
Yes Cubism
No Cutout
Yes Diffusion Tensors
No Dream Smoothing

I will note that the filter named sketchbw is not identified as that in the GIMP plugin but is named Sketch. In running through some of the others I see that their GIMP name does differ from the actual command name. This further complicates the ability to find doc about a command.

It would appear that having GIMP with the GMIC plugin with logging turned on is the only way to reliably document how a command works - which still doesn’t address the differences between the example command format listed on the gallery page and the logged command from the GIMP plugin version.

Note that my objective in all this was to be able to write batch programs that could be used to run experiments on the impact of parameter value changes on the output generated.

Thank you Afre,

I had downloaded the source and had been searching *.cpp, *.h, and *.gmic files. While I did find some doc, what I found in the .gmic file you referenced appeared to be the code that created the html gallery pages I referenced - along with the command listed there. Beyond that, nothing.

And thanks for the pointer to the community includes.

Yes, all those have been designed only as filters for the plug-in, so there is no specific documentation for them. Also, some have also been done by other developers.
The purpose of the gallery on the G’MIC web page is to demonstrate what kind of stuffs we can do with G’MIC, the command is here mainly for reproducibility :slight_smile:

I’m aware that the G’MIC doc is largely incomplete. But the amount of work required is so large that I’m not even sure this will be completed one day.

Hi David,

Understandable. I wanted to make sure that I wasn’t missing something re the command doc.

And personally I hate doing documentation - which is one reason why I haven’t released any of the generative art programs I’ve written.

To summarize, it would appear that if you want to use any of these filters in a command line environment then you need to first install GIMP and the GMIC plugin with logging turned on, run each filter that you are interested in using and then map the command output listing in the log file to the dialog boxes in the plugin.

Yes, and this part is quite trivial, as the arguments on the command line are ordered the same ways as parameters appear in selected filter of the plug-in.

I think this should be addressed eventually because every month or so I seem to be answering the same questions regarding using #@gui filters in CLI or batch code. Since I discovered G’MIC, I have been secretly hoping for any of the following:

1. Being able to do gmic help gui_filter and having it output the parameter list (i.e. #@gui : .. output). Quick way to see what the filter is about. @JimPlaxco would like that.

2. Being able to do gmic gui_filter , and having it apply all the default parameters. Personally, this is the feature that I would like to have the most because some of the filters have 50+ parameters! Imagine typing everything out and double checking!

3. Being able to do something like gmic-gui and having a stripped down standalone GUI to play around with the parameters and a display for feedback. No installation or running of GIMP necessary, etc. The advantage of this would be to have controllable verbosity. This point is more challenging to do than #2 but I still want it :stuck_out_tongue:. @Reptorian would like the verbosity part.

1 Like

I believe you can install the gmic at front end separate from gimp and launch it on its own. A shell alias to gmic-gui and you have #3

I read this on an old post but haven’t gotten around to exploring it. Some hints in the right direction on various platforms including Windows would be appreciated. I think a GUI on the CLI interface would have to be different from the plugin to work well.

Looks like you’d need to compile it yourself for windows. There is a cmake variable to set the host, I assume “none” means standalone.