Release of G'MIC 2.9

Very good, it comes now an error message from pink wrapper

Bildschirmfoto 2020-03-18 um 22.46.31.png

This general error comes e.g. if the format of the input file is wrong, (gmic image.jpg / 4 pink asf,5) . Here the written format is float not char as expected.

Is it possible that this 2.10.18 gimp changes the numbers before it is fed to the gmic function?

1 Like

Ahh, that is interesting!
At least now we are sure this doesn’t come from a timeout problem, but from something else!

By the way, there are also interesting errors in the other non-pink functions mentioned earlier (Reptorian Joan Rake!

What filter is it?

At least this better signaling is a real improvement . It is too difficult to trace inside the plugin.

Tomorrow I will look to extend the wrapper to allow a forced file format. For the two other lines in the plugin I have already build in a “round”. All the examples accept only byte data.

JFIF Effects

Channel Overblur-Overline-Blur…

Edit 2 Still this happens only in one Gimp build!!

Edit 3 By the way, were you successful with pink build? I am still convinced there are jewels in it!

It seems this one has clearly a bug in its code. No time to look at it, but probably something to fix in the filter code. I also get an error when I call the corresponding command from the shell:

$ gmic ~/work/src/gmic-community/include/reptorian.gmic sp lena fx_OOBS 0,0,1,1,1,1,0,0,1,1,21,100,0,1,1,21,100,0,1,1,21,100,0,1,1,21,100,0,1,1,21,100,0
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input custom command file '/home/dtschump/work/src/gmic-community/include/reptorian.gmic' (475 replaced, total: 4176).
[gmic]-1./ Input sample image 'lena' (1 image 512x512x1x3).
[gmic] *** Error in ./fx_OOBS/ (file '/home/dtschump/work/src/gmic-community/include/reptorian.gmic', line #4493) *** Command 'local': Invalid selection [1] (contains index '1', not in range -1...0).

No there is something wrong during the link. I don’t get any of the executable working, even with your version of the CMakeLists.txt. I’ve given up with the compilation.

Ja, I had problems too. Its a pity, but Michel Couprie is already retired like me and I don’t know who is doing something with that package. Perhaps I’ll find time to look for the pink build…

Bonne nuit!

PS Quick thorough infection to come again to some more or less good immunization and normality!

@KaRo I want to point out that fx_OOBS is a very old effect. I never bothered to go back to it other than remove the {} to make it work on Krita. If one were to test my filter, I’d recommend the newer ones like Majority or Axis Streak or Rotate by Torus Map, or the ones that are maintained better like the Thorn Fractal filter.

@Reptorian, don’t bother about the repeated mentioning of routines from you. It was only since a certain signal appeared similar to the one in my routine! I did not try it for any image processing purpose. However with new messages it becomes more easy to locate errors.

Re: Smaller size Gimp plugin

Todays update: (19 March) Seem to have that ‘-flto’ Starts off like this;

 g++ -c -pipe -O2 -fopenmp -flto -Ofast -std=gnu++11 -pthread -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -Dcimg_use_cpp11=1 -Dcimg_use_fftw3 -Dcimg_use_zlib -Dgmic_build -Dcimg_use_abort -Dgmic_is_parallel -Dcimg_use_curl -Dcimg_use_png -Dcimg_appname=\"gmic\" -Dgmic_prerelease=\"200319\" -Dcimg_display=1 -D_IS_LINUX_ -DGMIC_HOST=gimp -DGIMP_DISABLE_DEPRECATED -Dcimg_use_openmp -Dgmic_gui -

Thanks, after checking with the plug-in dev, it’s actually OK. Flag flto is enabled by default for all Linux builds (but not on Windows).
That explains the smaller size, with no doubts :slight_smile:

I discovered a bug. See below. The TIF is large and has negative values. When I select an image from display’s multi-view, it crashes in 1-2s.

gmic 4920.tif ^< 0 s c
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input all frames of TIFF file '4920.tif' at position 0 (1 image 7372x4920x1x3).
[gmic]-1./ Compute boolean 'less than' between image [0] and 0.
[gmic]-1./ Split image [0] along the 'c'-axis.
[gmic]-3./ Display images [0,1,2] = '4920.tif, 4920_c1.tif, 4920_c1.tif'.
[0] = '4920.tif':
  size = (7372,4920,1,1) [138 Mio of floats].
  data = (0,0,0,0,0,0,0,0,0,0,0,0,(...),0,0,0,0,0,0,0,0,0,0,0,0).
  min = 0, max = 1, mean = 2.04024e-006, std = 0.00142837, coords_min = (0,0,0,0), coords_max = (7306,3,0,0).
[1] = '4920_c1.tif':
  size = (7372,4920,1,1) [138 Mio of floats].
  data = (0,0,0,0,0,0,0,0,0,0,0,0,(...),0,0,0,0,0,0,0,0,0,0,0,0).
  min = 0, max = 1, mean = 2.75708e-008, std = 0.000166045, coords_min = (0,0,0,0), coords_max = (1909,4130,0,0).
[2] = '4920_c1.tif':
  size = (7372,4920,1,1) [138 Mio of floats].
  data = (0,0,0,0,0,0,0,0,0,0,0,0,(...),0,0,0,0,0,0,0,0,0,0,0,0).
  min = 0, max = 1, mean = 0.00782884, std = 0.0881337, coords_min = (0,0,0,0), coords_max = (3755,922,0,0).
[gmic]-3./ *** Error *** Unable to display image '4920.tif, 4920_c1.tif, 4920_c1.tif'.
[gmic]-3./ End G'MIC interpreter.

I also get additional messages when I do

gmic version

[gmic] *** Error in ./version/__help_header_ascii/*substitute/strver/ *** Command 'input': Invalid argument '('290')'.
[gmic] Command 'input' has the following description:

  gmic: GREYC's Magic for Image Computing: command-line interface
        (https://gmic.eu)
        Version 2.9.0 (pre-release #200311)

        Copyright (c) 2008-2020, David Tschumperle / GREYC / CNRS.
        (https://www.greyc.fr)

Edit Something terribly wrong. Crash happens when a single image is on display. gmic crashes when I move the cursor over the window or switch windows.

I think you need to upgrade your gmic binary to the latest pre-release version, because lot of new stuffs appeared in the G’MIC code these last days, and gmic_stdlib.gmic has been updated to reflect those changes. It’s likely you got the latest gmic_stdlib.gmic but used a binary version that is too “old”.
As I’m confined, I spend a lot of energy improving the G’MIC code and implementing new features. So I will generate pre-releases more frequently.

Got new binary. What happened was I did gmic or gmic version to check the version. With that, gmic updated the stdlib automatically and broke compatibility.

Yes, that is what I thought also :slight_smile:
Hopefully, it shouldn’t break too much in the future, as I don’t really have ideas for new features!

I have a idea. A button for randomizing values between min/max ranges? As you can see, I’m working on a filter that could benefit from it. The problem with seed and srand is that I cannot finetune the settings.

You can already do that with u(min,max).

I’m talking about gui, and then randomizing values from the gui standpoint

That’s already possible to add your own ‘Randomize’ button if needed.
Something as:

#@gui Foo random : rand_foo, rand_foo_preview
#@gui : Param1 = float(0,-100,100)
#@gui : Param2 = float(0,0,3)
#@gui : Randomize = button()
rand_foo :
  * $2 + $1 c 0,255

rand_foo_preview :
  p1,p2=$1,$2
  if $3 p1,p2={[u(-100,100),u(0,3)]} fi
  rand_foo $p1,$p2
  u "{"$p1"}{"$p2"}{0}"
1 Like

@David_Tschumperle

I have been trying to access vectors outside of eval and fill. Can this be a new feature so that I wouldn’t have to create images to do this?

foo:
channel_order=[0,1,2]
repeat 3
echo {$channel_order[$>]}
done

This gives me a error


The reason I need something like that is that I can make this command work without needing to create new image.

#@cli rep_tg3: eq. to 'rep_trigometric_three_channel_gradient' : (+)
rep_tg3: rep_trigometric_three_channel_gradient $*
#@cli rep_trigometric_three_channel_gradient: _resolution,_chan_order={ 0=abc | 1=acb | 2=bac | 3=bca | 4=cab | 5=cba },_chan_form_a={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier_a>0,_valueshift_a,0>=_midgray_expf_a>=1,_lightness_merge_factor_a>=1,_lightness_end_expf_a>0,0>=_gray2col_end_a>=1,_chan_form_b={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier_b>0,_valueshift_b,0>=_midgray_expf_b>=1,_lightness_merge_factor_b>=1,_lightness_end_expf_b>0,0>=_gray2col_end_b>=1,_chan_form_c={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier_c>0,_valueshift_c,0>=_midgray_expf_c>=1,_lightness_merge_factor_c>=1,_lightness_end_expf_c>0,0>=_gray2col_end_c>=1
#@cli : Creates trigometric gradients or map images with trigometric coloring.
#@cli : (eq. to 'rep_tg3').\n
#@cli : '_resolution' defines the length of gradient or the way it is going to be mapped. See below for more information on _resolution.
#@cli : '_chan_order' defines the order of channel of gradient
#@cli : '_chan_form' refers to the formula each channels use
#@cli : '_multiplier' defines the multiplication of base gradient used to map trigometric formula.
#@cli : '_valueshift' refers to the value shift of base gradient
#@cli : '_midgray_expf' refers to the middle-point of base gradient used to map trigometric formula relative to middle.
#@cli : '_lightness_merge_factor' refers to the merging of lightness gradient with color gradient. Used to add white and black to gradient ends.
#@cli : '_lightness_end_expf' defines the magnitude of shades and tind of each end of end gradient
#@cli : '_gray2col_end' defines how much the end gradient overrides the base gradient\n
#@cli : '_resolution' values and processing info
#@cli : -----
#@cli : Info #1: If '_resolution' is a number: If _resolution is negative, create a 3-channel trigometric vertical gradient, else create 3-channel trigometric horizontal gradient.
#@cli : Info #2: If '_resolution' is "8i", then map trigometric function by first dividing by 255, then perform trigometric function, finally multiply by 255.
#@cli : Info #3: If '_resolution' is "8l", then map trigometric using luminosity of images using 8-bit values.
#@cli : Info #3: If '_resolution' is "l", then map trigometric using luminosity of images.
#@cli : Info #4: If '_resolution' is "m", then divide by the maximum value, then perform trigometric function.
#@cli : Info #4: If '_resolution' is "", then directly map trigometric function.
#@cli : -----\n
#@cli : Default values: 'resolution=256','_chan_order=0','_chan_form_a=0','_multiplier_a=1','_valueshift_a=0','_midgray_expf_a=1','_lightness_merge_factor_a=1','_lightness_end_expf_a=0','_gray2col_end_a=1','_chan_form_b=_chan_form_a','_multiplier_b=_multiplier_a','_valueshift_b=_valueshift_a','_midgray_expf_b=_midgray_expf_a','_lightness_merge_factor_b=_lightness_merge_factor_a','_lightness_end_expf_b=_lightness_end_expf_a','_gray2col_end_b=_gray2col_end_a','_chan_form_c=_chan_form_b','_multiplier_c=_multiplier_b','_valueshift_c=_valueshift_b','_midgray_expf_c=_midgray_expf_b','_lightness_merge_factor_c=_lightness_merge_factor_b','_lightness_end_expf_c=_lightness_end_expf_b','_gray2col_end_c=_gray2col_end_b'
rep_trigometric_three_channel_gradient:
skip ${1=256},${2=0},${3=},${4=},${5=},${6=},${7=},${8=},${9=},${10=},${11=},${12=},${13=},${14=},${15=},${16=},${17=},${18=},${19=},${20=},${21=},${22=},${23=}

val=$1

if narg($3) channel_formula=vector3($3)            else channel_formula=vector3(0)        fi
if narg($4) multiplier=vector3($4)                 else multiplier=vector3(1)             fi
if narg($5) valueshift=vector3($5)                 else valueshift=vector3(0)             fi
if narg($6) midgray_expf=vector3($6)               else midgray_expf=vector3(1)           fi
if narg($7) lightness_merge_factor=vector3($7)     else lightness_merge_factor=vector3(1) fi
if narg($8) lightness_end_expf=vector3($8)         else lightness_end_expf=vector3(0)     fi
if narg($9) gray2col_end=vector3($9)               else gray2col_end=vector3(1)           fi

if narg($10) channel_formula[1,2]=$10           fi
if narg($11) multiplier[1,2]=$11                fi
if narg($12) valueshift[1,2]=$12                fi
if narg($13) midgray_expf[1,2]=$13              fi
if narg($14) lightness_merge_factor[1,2]=$14    fi
if narg($15) lightness_end_expf[1,2]=$15        fi
if narg($16) gray2col_end[1,2]=$16              fi

if narg($17) channel_formula[2]=$17           fi
if narg($18) multiplier[2]=$18                fi
if narg($19) valueshift[2]=$19                fi
if narg($20) midgray_expf[2]=$20              fi
if narg($21) lightness_merge_factor[2]=$21    fi
if narg($22) lightness_end_expf[2]=$22        fi
if narg($23) gray2col_end[2]=$23              fi

if   $2==0 channel_order=[0,1,2]
elif $2==1 channel_order=[0,2,1]
elif $2==2 channel_order=[1,0,2]
elif $2==3 channel_order=[1,2,0]
elif $2==4 channel_order=[2,0,1]
elif $2==5 channel_order=[2,1,0]
fi

if isnum($1)
    if $1>0   $1,1,1,3,"begin(ww=w-1;);x/ww"
    elif $1<0 1,abs($1),1,3,"begin(hh=h-1;);y/hh"
    else error "_resolution!=0==F"
    fi
    
    e $channel_order
    
    repeat 3
        sh. {$channel_order[$>]}
        rep_trigmap. 1,{$channel_formula[$>]},{$multiplier[$>]},{$valueshift[$>]},{$midgray_expf[$>]},{$lightness_merge_factor[$>]},{$lightness_end_expf[$>]},{$gray2col_end[$>]}
        rm.
    done
fi

#@cli rep_trigmap: eq. to 'rep_trigometric_map' : (+)
rep_trigmap: rep_trigometric_map $*
#@cli rep_trigometric_map: _image_value_divide,_level_formula={ 0=sinusoidal | 1=cosinusoidal | 2=cubic-sinusoidal | 3=cubic-cosinusoidal | 4=cubic-sinusoidal-cosinusoidal },_multiplier>0,_valueshift,0>=_midgray_expf>=1,_lightness_merge_factor>=1,_lightness_end_expf>0,0>=_gray2col_end>=1
#@cli : Map trigometric function into image.
#@cli : (eq. to 'rep_trigmap').\n
#@cli : '_chan_form' refers to the formula each channels use
#@cli : '_multiplier' defines the multiplication of base gradient used to map trigometric formula.
#@cli : '_valueshift' refers to the value shift of base gradient
#@cli : '_midgray_expf' refers to the middle-point of base gradient used to map trigometric formula relative to middle.
#@cli : '_lightness_merge_factor' refers to the merging of lightness gradient with color gradient. Used to add white and black to gradient ends.
#@cli : '_lightness_end_expf' defines the magnitude of shades and tind of each end of end gradient
#@cli : '_gray2col_end' defines how much the end gradient overrides the base gradient\n
#@cli : Default values: '_image_value_divide=1','_multiplier_a=1','_valueshift_a=0','_midgray_expf_a=1','_lightness_merge_factor_a=1','_lightness_end_expf_a=0','_gray2col_end_a=1'
rep_trigometric_map:
skip ${1=1},${2=0},${3=1},${4=0},${5=1},${6=1},${7=0},${8=1}
if $1==0 error ""$"1!=0==f" fi
f "
begin(
if($2==0,level_formula(a)=(sin(a*pi)+1)/2;,
if($2==1,level_formula(a)=(cos(a*pi)+1)/2;,
if($2==2,level_formula(a)=(sin(a*pi+pi)^3+1)/2;,
if($2==3,level_formula(a)=(cos(a*pi+pi)^3+1)/2;,
         level_formula(a)=((cos(a*pi+pi/2)*sin(a*pi+pi/2))^3+.125)*4;
);
);
);
);

);
slope=i/$1;
midslope=(max(1-slope,slope)-.5)*2;
col_chan_zero=level_formula($3*(slope^$5+$4));
mul_chan_zero=lerp(col_chan_zero,lerp(slope*col_chan_zero,slope,midslope^(abs($7+1))) ,midslope^(abs($7+1))*$6);
lerp(slope,mul_chan_zero,$8)*$1;
"