In code shown above, G’MIC caps the diameter (D) of the Gaussian filter. IM can cap the radius (R) (EDIT: I mean R in parentheses, not registered trademark. I hate computers that think they are smarter than me.), where D = 2*R+1.
The following is Windows BAT syntax, but copy-paste removes the new lines, so you’ll have to imagine them.
First, with G’MIC:
%GMIC% 11,11,1,1 gaussian 2,2 normalize_sum print
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input black image at position 0 (1 image 11x11x1x1).
[gmic]-1./ Draw centered gaussian on image [0] with standard deviations (2,2) an
d angle 0 deg.
[gmic]-1./ Normalize image [0] with a unitary sum.
[gmic]-1./ Print image [0] = '[unnamed]'.
[0] = '[unnamed]':
size = (11,11,1,1) [484 b of floats].
data = (7.76554e-005,0.000239195,0.0005738,0.001072,0.00155975,0.00176743,0.00155975,0.001072,0.0005738,0.000239195,7.76554e-005;0.000239195,(...),0.000239195;7.76554e-005,0.000239195,0.0005738,0.001072,0.00155975,0.00176743,0.00155975,0.001072,0.0005738,0.000239195,7.76554e-005).
min = 7.76554e-005, max = 0.0402265, mean = 0.00826446, std = 0.0100279, coords_min = (0,0,0,0), coords_max = (5,5,0,0).
[gmic]-1./ End G'MIC interpreter.
Now, with IM:
%IM%convert ^
xc: ^
-define showkernel=1 ^
-morphology Convolve:0 Gaussian:5x2 ^
null:
Kernel "Gaussian" of size 11x11+5+5 with values from 0 to 0.0402265
Forming a output range from 0 to 1 (Normalized)
0: 7.76554e-005 0.000239195 0.0005738 0.001072 0.00155975 0.00176743 0.0015597
5 0.001072 0.0005738 0.000239195 7.76554e-005
1: 0.000239195 0.000736774 0.00176743 0.00330199 0.00480437 0.00544406 0.00480437 0.00330199 0.00176743 0.000736774 0.000239195
2: 0.0005738 0.00176743 0.00423984 0.00792106 0.0115251 0.0130596 0.0115251 0.00792106 0.00423984 0.00176743 0.0005738
3: 0.001072 0.00330199 0.00792106 0.0147985 0.0215317 0.0243986 0.0215317 0.0147985 0.00792106 0.00330199 0.001072
4: 0.00155975 0.00480437 0.0115251 0.0215317 0.0313284 0.0354997 0.0313284 0.0215317 0.0115251 0.00480437 0.00155975
5: 0.00176743 0.00544406 0.0130596 0.0243986 0.0354997 0.0402265 0.0354997 0.0243986 0.0130596 0.00544406 0.00176743
6: 0.00155975 0.00480437 0.0115251 0.0215317 0.0313284 0.0354997 0.0313284 0.0215317 0.0115251 0.00480437 0.00155975
7: 0.001072 0.00330199 0.00792106 0.0147985 0.0215317 0.0243986 0.0215317 0.0147985 0.00792106 0.00330199 0.001072
8: 0.0005738 0.00176743 0.00423984 0.00792106 0.0115251 0.0130596 0.0115251 0.00792106 0.00423984 0.00176743 0.0005738
9: 0.000239195 0.000736774 0.00176743 0.00330199 0.00480437 0.00544406 0.00480437 0.00330199 0.00176743 0.000736774 0.000239195
10: 7.76554e-005 0.000239195 0.0005738 0.001072 0.00155975 0.00176743 0.00155975 0.001072 0.0005738 0.000239195 7.76554e-005
Compare the values from G’MIC and IM: they are the same (phew!).
By asking for a radius of zero, IM will automatically calculate the minimum radius that doesn’t lose precision:
%IM%convert ^
xc: ^
-define showkernel=1 ^
-morphology Convolve:0 Gaussian:0x2 ^
null: 2>&1 | findstr Kernel
Kernel "Gaussian" of size 15x15+7+7 with values from 0 to 0.0398008
So, if we use 15,15,1,1 in GMIC, we will get the same values as IM’s “Gaussian:0x2” or “Gaussian:7x2”. I won’t bore you with it, but I have checked, and they are the same.
I don’t know if G’MIC can automatically calculate the radius. But we can make the kernel over-large and then “autocrop” (EDIT: which is like IM’s “-trim”):
%GMIC% 20,20,1,1 gaussian 2,2 normalize_sum autocrop print