G'MIC CLI Readme Script Problem on Windows 11

Hi everyone, Been quite a while since I’ve been here. I finally got around to installing G’MIC CLI (version 3.6.6) on my year old Windows 11 PC. I tried running the CLI test command contained in the readme doc but even though I got no error messages, it created only that single bottle test image file and not the “lots” of files the doc says to expect. The command is near the top of the README and is:

$ gmic input_text https://gmic.eu/gmic_stdlib.\$_version parse_cli images

So I ran the following command which was a working command using the version of G’MIC that was installed on my old PC:

gmic -input inputtest.png fx_MappedSmooth 0,1,0,300,1,0 c 0,255 -output mapsmooth.tif

and it worked fine.

So is there a problem with the test script or do I have an actual problem with my installed copy of G’MIC?

Thanks.

It works for me:

[gmic]./ Start G'MIC interpreter (v.3.7.0).
[gmic]./ Input text-data file 'https://gmic.eu/gmic_stdlib.370'.
[gmic]./ Parse '#@cli' command(s) '*' and output in 'images' mode.


 ** Section #1: Global Options.                                                                                                                                                        


 ** Section #2: Input / Output.                                                                                                                                                        

[1] Command 'command': $ image.jpg command "foo : mirror y deform $""1" +foo[0] 5 +foo[0] 15 (done in 0.03s).
[2] Command 'display_clut': $ clut tealorange clut summer clut 60s display_clut 400 (done in 0.43s).
[3] Command 'display_fft': $ image.jpg +display_fft (done in 0.09s).
[4] Command 'display_graph': $ 128,1,1,1,'cos(x/10+u)' +display_graph 400,300,3 (done in 0.01s).
[5] Command 'display_histogram': $ image.jpg +display_histogram 512,300 (done in 0.02s).
[6] Command 'display_parametric': $ 1024,1,1,2,'t=x/40;(!c?sin(t):cos(t))*(exp(cos(t))-2*cos(4*t)-sin(t/12)^5)' display_parametric 512,512 (done in 0.01s).
[7] Command 'display_parametric': $ 1000,1,1,2,u(-100,100) quantize 4,1 noise 12 channels 0,2 +normalize 0,255 append c display_parametric 512,512,0.1,8 (done in 0.02s).
[8] Command 'display_polar': $ 300,1,1,1,'0.3+abs(cos(10*pi*x/w))+u(0.4)' display_polar 512,512,4,200,255,200 (done in 0.01s).
[9] Command 'display_polar': $ 3000,1,1,1,'x^3/1e10' display_polar 400,400,1,-1,,,0,{15*360} (done in 0.01s).
[10] Command 'display_quiver': $ image.jpg +luminance gradient[-1] xy rv[-2,-1] *[-2] -1 a[-2,-1] c crop 60,10,90,30 +display_quiver[1] , (done in 0.04s).
[11] Command 'display_rgba': $ image.jpg +norm threshold[-1] 40% blur[-1] 3 normalize[-1] 0,255 append c display_rgba (done in 0s).
[12] Command 'display_tensors': $ image.jpg +diffusiontensors 0.1,0.9 rescale2d. 64 +display_tensors. 16,2 (done in 0.11s).
[13] Command 'display_warp': $ 400,400,1,2,'x=x-w/2;y=y-h/2;r=sqrt(x*x+y*y);a=atan2(y,x);5*sin(r/10)*[cos(a),sin(a)]' +display_warp 10 (done in 0.03s).
[14] Command 'font': $ 400,300,1,3 text "Hello World!",0.5~,0.5~,${"font \"Cheese Burger\",80"},1,255,255,128 (done in 0.1s).
[15] Command 'function1d': $ function1d 1,0,0,10,30,40,20,70,30,80,0 +display_graph 400,300 (done in 0s).
[16] Command 'identity': $ identity 5,1 identity 8,8 (done in 0s).
[17] Command 'input': $ input image.jpg (done in 0s).
[18] Command 'input': $ input (1,2,3;4,5,6;7,8,9^9,8,7;6,5,4;3,2,1) (done in 0s).
[19] Command 'input': $ image.jpg (1,2,3;4,5,6;7,8,9) (255^128^64) 400,400,1,3,'(x>w/2?x:y)*c' (done in 0s).
[20] Command 'pass': $ command "average : pass$""1 add[^-1] [-1] remove[-1] div 2" sample ? +mirror y +average[0] [1] (done in 0.03s).
[21] Command 'poincare_disk': $ repeat 4 { poincare_disk 1024,{3+$>} channels[-1] 2 mod[-1] 3 neq[-1] 2 } rescale2d 50% (done in 0.45s).
[22] Command 'random_patches': $ random_patches 16,64 split z append_tiles , (done in 0.35s).
[23] Command 'random_pattern': $ repeat 6 { random_pattern 256 } (done in 0.8s).
[24] Command 'serialize': $ image.jpg +serialize uint8 +unserialize[-1] (done in 0.04s).
[25] Command 'shape_circle': $ shape_circle , (done in 0.01s).
[26] Command 'shape_cupid': $ shape_cupid , (done in 0.06s).
[27] Command 'shape_diamond': $ shape_diamond , (done in 0s).
[28] Command 'shape_dragon': $ shape_dragon , (done in 0.15s).
[29] Command 'shape_fern': $ shape_fern , (done in 0.03s).
[30] Command 'shape_gear': $ shape_gear , (done in 0s).
[31] Command 'shape_heart': $ shape_heart , (done in 0s).
[32] Command 'shape_menger': $ shape_menger 4 surfels3d , color3d 200 m3d 3 (done in 0.11s).
[33] Command 'shape_mosely': $ shape_mosely 4 surfels3d , color3d 200 m3d 3 (done in 0.08s).
[34] Command 'shape_polygon': $ repeat 6 { shape_polygon 256,{3+$>} } (done in 0s).
[35] Command 'shape_rays': $ shape_rays 400,50%,50%,7 shape_rays 400,50%,50%,3,0,3 (done in 0.03s).
[36] Command 'shape_snowflake': $ repeat 6 { shape_snowflake 256,$> } (done in 0.01s).
[37] Command 'shape_star': $ repeat 9 { shape_star 256,{$>+2} } (done in 0.01s).
[38] Command 'shared': $ image.jpg shared 1 blur[-1] 3 remove[-1] (done in 0.02s).
[39] Command 'shared': $ image.jpg repeat s { shared 25%,75%,0,$> mirror[-1] x remove[-1] } (done in 0s).
[40] Command 'sample': $ repeat 6 { sample } (done in 0.1s).
[41] Command 'store': $ sample eagle,earth store img1,img2 input $img2 $img1 (done in 0.03s).
[42] Command 'testimage2d': $ testimage2d 512 (done in 0.04s).
[43] Command 'uniform_distribution': $ uniform_distribution 64,3 * 255 +distribution3d circles3d[-1] 10 (done in 0s).

 ** Section #3: List Manipulation.                                                                                                                                                     

[44] Command 'keep': $ image.jpg split x keep[0-50%:2] append x (done in 0s).
[45] Command 'keep': $ image.jpg split x keep[^30%-70%] append x (done in 0.01s).
[46] Command 'move': $ image.jpg split x,3 move[1] 0 (done in 0s).
[47] Command 'move': $ image.jpg split x move[50%--1:2] 0 append x (done in 0.01s).
[48] Command 'name': $ image.jpg name image blur[image] 2 (done in 0s).
[49] Command 'remove': $ image.jpg split x remove[30%-70%] append x (done in 0s).
[50] Command 'remove': $ image.jpg split x remove[0-50%:2] append x (done in 0s).
(...)

What does it print on the shell for you ?

Hi David,
This is what I get:

gmic input_text https://gmic.eu/gmic_stdlib.\$_version parse_cli images
[gmic]./ Start G'MIC interpreter (v.3.6.6).
[gmic]./ Input text-data file 'https://gmic.eu/gmic_stdlib.$_version'.
[gmic]./ Parse '#@cli' command(s) '*' and output in 'images' mode.

[gmic]./ End G'MIC interpreter.

The same first lines that you get but then nothing. I also tried running it in admin mode just in case it was a permissions issue but got the same results.

I do see that we are running different versions of the CLI. Could that be the problem?

I think it is a problem of output redirection. “parse_cli images” and “parse_cli print” differs. Try to redirect the output into a file, works with “print” but not with “images”.

By the way my routine “parse_cli images” stops in or after denoise_cnn:

[340] Command ‘denoise_cnn’: $ image.jpg noise 20 cut 0,255 +denoise_cnn 0

[gmic] *** Error in ./parse_cli/parse_cli_images/*repeat/(…)/denoise_cnn/*local/run/__run/ *** Unknown command or filename ‘nn_fcnl’.

Ah yes, definitely.
With bash (the shell I use on Linux), we have to backslash the dollar sign.
Apparently, you don’t have to, when using cmd.exe (on Windows, I suppose this is the one you use?).

So, on Windows, with cmd.exe, just try:

> gmic input_text https://gmic.eu/gmic_stdlib.$_version parse_cli images

and it should work (at least it worked for me!).
You didn’t get any error message because I suppose trying to downloading the file returned a text file with an error message in it (like “Error 404” ot whatever), and so there was nothing to parse in it :slight_smile:

@KaRo , you should try to delete the file gmic_denoise_cnn.gmz that is located in your G’MIC resource folder ($ gmic e \$_path_rc), because it seems your file use some quite ancien nn_lib commands that do not exist anymore.

Hmm hmm that did not help. There was no file gmic_denoise_cnn.gmz. I even deleted the configuration folder .config/gmic

Oups sorry, I should have said the cache folder, which is :

$ gmic e '${-path_cache}'
[gmic]./ Start G'MIC interpreter (v.3.7.0).
/home/tschumperle/.cache/gmic/
[gmic]./ End G'MIC interpreter.

Yes, thank you, that was it.

1 Like

Hi David,
I followed your suggestion and do seem to have gotten the correct output. The program ran fine but did terminate with the following error:

[gmic] *** Error in ./parse_cli/parse_cli_images/*repeat/(…)/run_example/scale2x_cnn/run/__run/ *** Unknown command or filename ‘nn_conv2dnl’.

Thanks for your help.

That’s probably the same error as @KaRo had.
You just have to delete the file gmic_denoise_cnn.gmz located in your G’MIC cache folder
(on Windows, %APPDATA%/gmic).