Hello there,
I’d like to get your opinion about something:
In G’MIC, some commands propose an interactive mode when no valid arguments are specified.
This is the case for commands crop
, resize
, threshold
and cut
.
For instance,
$ gmic input.png resize output resized_output.png
will display an interactive window that you can resize to set the new dimensions of the image.
After several years of G’MIC scripting, I have the impression that while the interactive mode is useful for one of these command (clearly, crop
, I use its interactive mode quite often from the command line), it is a burden for the others.
Particularly, for command resize
: this is one of the most used command in G’MIC scripts, and it will never throws an error. For instance, a usual error case is this:
$ gmic input.png resize 100%,{h/3},1,3
This is intended to divide the height of the input image by two, and it works, except when the input image has less than 3 rows. In this case, {h/3}
is rounded to 0
, and the argument passed to command resize
is 100%,0,1,3
which is not valid, and thus, resize
considers it has no arguments and opens an interactive window, which is clearly disturbing for the developer of G’MIC scripts.
So, I’m really thinking about removing the interactive modes from these commands, which also don’t seem to me to be used much in practice.
And if needed, I plan to replace them by other custom commands, like e.g. icrop
, iresize
, ithreshold
and icut
. This is possible, and it could avoid the problem of having bad arguments in G’MIC scripts without throwing an error immediately.
Do you have any suggestions on that ?
@KaRo ? Don’t you use the interactive modes for the cut
or threshold
commands ?
@garagecoder, @Iain, @Jerome_Boulanger, @grosgood, @rich2005, @Joan_Rake1, @Souphead, @McCap, @Reptorian, @samj, @afre, and others ?