Question about Iain's noise reduction

Apparently I’m doing something wrong here, but I don’t see what. Can someone point me in the right direction? Thanks in advance for that!

I launch Gimp from a terminal, open a photo, start G’MIC and say that Output messages must be Verbose and sent to console.
Then i select Iain’s noise reduction filter. Console output is:
[gmic_gimp]./preview/ -v -99 -iain_iains_nr_preview 0.613497,9.07975,2,609.756,390.244,0,1,0,0,0,1.35,0,0

Then I click on OK, output is:
[gmic_gimp]./apply/ -v -99 -iain_iains_nr 0.613497,9.07975,2,609.756,390.244,0,1,0,0,0,1.35,0,0

Now I want to apply this filter with these settings from the command line
and write the result to the new file NR.jpg but I get the following:

paul@graveyron:~$ gmic DSC_9524.JPG -iain_iains_nr 0.613497,9.07975,2,609.756,390.244,0,1,0,0,0,1.35,0,0 -o NR.jpg
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Input file ‘DSC_9524.JPG’ at position 0 (1 image 4928x3264x1x3).
[gmic]-1./ Input file ‘-iain_iains_nr’ at position 1
[gmic]-1./ * Error * Unknown command or filename ‘-iain_iains_nr’.

My question is: why is -iain_iains_nr unknown? I can use other gmic filters this way without these error messages.

You might need to tell gmic to use the ‘gimp_update172.gmic’ file with -command

-command (+):

 _add_debug_info={ 0 | 1 }, { filename | http[s]://URL | "string" }

Import G'MIC custom commands from specified file, URL or string. 
(eq. to '-m'). 
Imported commands are available directly after the '-command' invocation.

Maybe something simpler :

$ gmic -update
$ gmic  DSC_9524.JPG -iain_iains_nr 0.613497,9.07975,2,609.756,390.244,0,1,0,0,0,1.35,0,0 -o NR.jpg

Iain and David,

Thanks for your help, the gmic -update command did the trick!

Maybe some additional info about this : the command line tool gmic does only contain by default commands that are a part of the G’MIC standard library (defined in file gmic_stdlib.gmic only). This avoids over weighting the binary size with the inclusion of a lot of commands that are probably not of interest for a usual command line use (think about most of the filters in the Testing/ category of the GIMP plug-in for instance). Anyway, having more commands available is still a nice idea, that’s why invoking $ gmic -update downloads all available commands explicitly :wink:

I understand the idea, but Iain’s noise reduction filter is part of the official (ie. not testing) filter library (in version 1.7.2), isn’t it?

I’m working on an article about using gmic to batch process photos and used Iain’s NR filter as an example (because it is a bit cpu intensive). I suppose it is best to suggest readers to use the $ gmic -update command?

I prefer to avoid writing a manual that says
[gmic]-1./ * Error * Unknown command or filename ‘< a.certain.filter >’
at the end!
:wink:

@paulmatth: the G’MIC std lib is a bit more restrictive than just discarding the filters in Testing/. There are also other filters in the plug-in that are not included in it. Commands in the stdlib are those who are insured to get updates and maintenance from me, even if big changes are done on the way the G’MIC core works (which is almost unlikely to happen at this point of the project). Of course I try to maintain other’s commands as well, but I’m not sure enough I can do it cleanly enough to integrate them in the stdlib.
So, yes, definitely a $ gmic -update is a good idea when starting the CLI tool the first time (note that this is done automatically when running gmic without any arguments in the next versions 1.7.3+ ).