gmic command line is missing filters ?

Hi !
i’m using gmic on ubuntu, everything is working fine with some filters (cartoon, sketchbw, polygon), but i don’t have a lot of other filters (polygonize, brushify …)

I don’t understand where i’m supposed to get them, but everyone not using the command line seems to have it (http://gmic.eu/gimp.shtml, gmic-filters-overview demos, New filter 'Brushify' • GIMP Chat)

as i’m currently wanting the brushify filter, i thought i was outdated, (gmic - version tell me i’m in 1.5.7.1)
but apt-get install gimp && apt-get install gmic says i’m up to date

My questions are : how to get up to date (with the shell), and what do i need to do to access all the filters (like -brushify, or -gimp_colorsketchbw)

@Neilyroth Welcome to the forum! First, try gmic -up. If that doesn’t work:

Are you using Ubuntu 14.04.5 LTS (Trusty Tahr)? If so, unfortunately, gmic 1.5.7.1-4 is its most current package. Right now we are at version 2.0.3_pre. The latest packages can be found on the G’MIC website. For Trusty, you would need this: http://gmic.eu/files/prerelease/gmic_ubuntu_trusty_i386.deb.

1 Like

Thanks for the reply, I’m under 14.04.3,
I actually fixed my thing with http://gmic.eu/download.shtml, under the from source tab, an i’m finally under 2.0.3 :smiley:
thanks for the fix, and I hope i can just copy the binary in my project in order to access it from any computer :slight_smile:

Okay, I’m still having this problem TODAY.

I just downloaded the command line interface on Windows 10 and am using version 3.0.2.

I’m trying to batch process a folder of images and create output files in a separate folder.

e.g., \original ==> \processed

I can invoke cartoon, but not comic book or graphic novel. I’m also having difficulty finding the required parameters to use the -o command.

For example,

gmic .\0041.png 40,40 gaussian[-1] 10,4 spread[-1] 10,0 brushify[0] [1],1 -o …\processed\0041.png

works just fine, but

gmic image.png cartoon

does not save an output file, and if I add -o and the output file destination, I get an error message about missing parameters.

  1. How do I invoke particular filters if there are no commands for them? I understand that comic book is a new filter – does this mean that the comic book filter has not yet been added to the gmic command line interface?

  2. I understand that I can create custom command files to save default parameters, but how do I find out what the required parameters are?

Thank you.

Hi @Blaise
I can hopefully help with some of your problems - I hope others will chip in for the rest.

For file output: the output command (shortcut o) is a g’mic command. If you don’t use that command, g’mic will not create any files on disk. The default behaviour is to display images on screen rather than save anything to disk. So, to save any file you must use something like gmic myfile.png blur 10% output targetfile.png

Missing commands: it sounds like you need to get the latest update file. That’s usually done by running gmic up. If the commands are still not present, it sounds like the update is failing for some reason.

Command parameters: if you’re lucky, the filter author created some help for the command. You can get that with gmic help command. Sadly that’s not always the case and you might have to either get parameters from the gmic qt GUI, or by investigating the command definition.

Edit: there are gmic commands for processing of multiple files. It’s also possible to load multiple images in the stack at once, then output them. Strangely enough I never use anything like that, so not the best to advise you.

This is super handy: G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing - List of Commands.

Okay, I ran gmic up, but I’m still not finding comic book or graphic novel. (I’m still running ver 3.0.2, but I don’t know how to check the version of the update file.)

I would expect to find both of those under artistic, but I don’t see them on the list of commands page:

Artistic:

I’ve tried comic book, comicbook, comic_book, and had no success. I searched the list of commands page for “comic” and found no hits.

There’s also no help command for comic book or graphic novel or the variants I can think of.

The output instructions worked fine, thank you.

I’m confident I can use a bash script on Linux to process the multiple files, based on the instructions on the wiki page for processing many files:

  1. Use a shell script (linux)

The bash script below creates a grey version of all the files finishing with .jpg in the directory called ‘original’ and output them in the directory called ‘processed’:

cd original
for i in *jpg
do
gmic $i -to_gray -o ../processed/$i
done

Thank you,
Blaise

Well we certainly have a problem getting all parameters for those filters. They’re both “community” filters, with no help written as far as I know. It would be great if somebody who uses them would document the usage!

From looking at the definitions, the commands seem to be cl_comic which requires at least 16 arguments, and fx_graphic_novelfxl which has more than 20.

I really think the best way to get settings would be via the gmic qt GUI or plugin. There’s a button which copies all the current settings as a command you can paste to cli.

1 Like

Best to internalize command. E.g., gmic input_glob *.jpg repeat $! local[$>] to_gray output ../processed/{b}-v2.jpg endlocal done

You may want to include print at the end of the command sequence if you wish to prevent display from activating, which is the default behaviour. Depending on your shell, you may have to escape certain characters…

PS - the copy command button is at the top next to refresh parameters.

image

2 Likes

I can’t believe I didn’t know about print! Thanks, it’s a good one.

That is because command cartoon takes arguments, so if you just add -o after, it will be considered as the argument of cartoon. When this happens and you want to keep default argument values, just add a comma , after the command:

gmic image.png cartoon , -o output.png

Regarding the Comic Book and Graphic Novel filters : these filters are part of the gmic-community repository and are not included by default in the command line tool.
Usually, running:

gmic update

makes them available (it downloads the same filter file than the one used by the G’MIC-Qt plugin).

Thank you all for your help.

Last night I was able to write a .bash script on my Linux machine and got the result I wanted using cartoon. So now I have a video of me petting my dog that looks like a cartoon instead of live action.

GREAT SUCCESS!

Just now as I read your suggestions, I was able to get both comic book and graphic novel to work on Windows using PowerShell.

I’m confident I’ll be able to adjust my .bash script tonight to get them both to process a folder full of images.

For some reason, copying the settings for graphic novel gave me only 15 of the 16 parameters, but I just added “0” in the 16th position, and it worked.

  1. It appears that gmic up and gmic update do the same thing (up is just the abbreviated version), but the issue wasn’t that I needed an update, but rather that I needed to know how to properly invoke the commands, right?

  2. From now on, all I have to do to get the correct invocation of the filter and its parameters is use the copy button? That will be a big help.

Thank you very much.

This is an amazing tool!

1 Like

Not sure about that. In any case, when you install the G’MIC CLI tool on a new system, you won’t have gmic-community filters available by default, so gmic up is still a good thing to know :slight_smile:

Yes, this button has been implemented specifically for this purpose : play with the parameters with the Qt-interface (with the preview window), then get the corresponding command for batch-processing (or include it in a more complex image processing pipeline).
I’m glad this is useful for you.