How do I use the Sharpen [shock filters] filter in command line?

(terzag) #1

I use G’MIC with GIMP and I’d like to apply some filters on a bunch of pictures, so I’m trying to do what I did with GIMP but in command line. Using Ubuntu Linux with G’MIC 2.3.3.

I’m trying to use the filter “Sharpen [shock filters]” with its default values but I’m not sure how to. I’ve tried the following:

gmic Tx_wall_stone_01.tga -resize 400%,400% -fx_sharpen_shock -o Tx_wall_stone_01.png

but I get this error:

*** Error *** Command 'fx_sharpen_shock': Undefined argument '$5', in expression '$5' (for 1 argument specified).

I’ve also tried to add values after it (for Amplitude, Edge, etc. −the fileds that are in the dialog in GIMP) but same error with $7 instead of $5.

Looks like I’m missing an argument to the filter but I can’t find a proper description or syntax to use.


I think you need 8 arguments (because the filter doesn’t specify for command line). Try this with the rest of your line:

fx_sharpen_shock 150,0.1,0.8,1.1,1,0,0,0

The 5th to 8th are channels, threads, preview type settings.


This might help:

(terzag) #4

Thanks, it’s better, I get no more errors. Now, I have a different issue, as what I get doesn’t look like what I need at all but it seems to come from the resize option. I’ll have to investigate a bit more.

EDIT: ok, adding values for depth, spectrum and interpolation works as intended.

(terzag) #5

Oh, thanks: I was looking for that kind of output but couldn’t find it in the GIMP G’MIC UI. Didn’t notice there was an “other” tab in the options. That’ll be useful.