Release of G'MIC 1.6.6.1

Hello there,
I’m happy to announce the final release of version 1.6.6.1 of the G’MIC image processing framework.
Lot of improvements have been made in the G’MIC core, particularly for the math parser. We have now a very capable expression evaluator that will help writing new exciting filters in the future!
(see this link for more details about this particular point).

Here are the changes made since the latest release (1.6.5.2) :

New features:

  • [all] Improvements of the math parsers, with new function cut(),gauss(), debug(), pre-defined variables R,G,B,A and ternary operator cond?expr1:expr2. Boundary conditions can also be chosen in offset-specified pixel access i[] and j[].
  • [all] New command -div_complex to divide one or several complex pairs of images by another complex pair of images.
  • [all] When command selection is [-1], it can be now replaced by a single dot (so -blur[-1] and -blur. are two equivalent commands). Same for [-2] (shortcut ) and [-3] (shorcut ). [-3],[-2] and [-1] are so often uses that they deserve their own shortcuts. This will introduce incompatibilities of the new gmic_stdlib with older versions, so that a new major branch 1.6.6.x of G’MIC has been started.

Improvements:

  • [all] Various minor improvements for command -window.
  • [all] Math parser has been greatly optimized (more than +50% gain for complex expressions), as well as enriched with new possible “in-place” operators (++,–,+=,*=,…).
  • [all] Command -shared now accepts a single argument, as the indice of the image channel to share.
  • [gimp] Avoid preview flickering effect when changing filter parameters.
  • [gimp] The G’MIC plug-in for GIMP now uses GEGL buffers to read/write image data from/to GIMP. It means the plug-in is now able to retrieve high-bit depth buffers (16bits or 32bits/channels), when compiled for GIMP 2.9.
  • [gimp] Parameters labels can be now written using Pango Markup. It will eases the internationalization of filters.
  • [gimp] Japanese translation of the plug-in interface is now available.
  • [gmicol] Update of the G’MIC Online service, with a new look and new filters.

Bug fixes:

  • [all] Insufficient stack size was allocated for threads on Mac. This is now fixed, making G’MIC finally stable enough on Mac, even with multi-threaded filters. Thanks to Andrea for having figured out what was the issue.

2 Likes

Nice idea with “.” replacing/shortening “[-1]”.
Is/ will that also be added for “[-1]” (input) or parameters as in resize or -object3d (and -pass)?

No, only the image selections for commands will be impacted. It could be a bit of a mess otherwise !

  • 09/25/2015 : Final release today !
1 Like

Hello David. I have 2 questions.

  1. I don’t understand how to set sampling for JPEG using GMIC.
  2. How to add color saturation for image? I was looking for this in the PDF documentation, but could not find anything.
    Please, help me!
  1. No, you cannot set other JPEG options than the quality of the compression when saving an image with G’MIC. If you really want to retain the highest possible quality, I would recommend using a lossless format (.png for instance).

  2. Below could be a solution: it adds a constant to the saturation values of each pixel (assumed to be in [0,1]):

    $ gmic image.jpg -rgb2hsv -sh 1,1 -+[-1] 0.3 -rm[-1] -hsv2rgb -o output.jpg

Thanks for the help! I have another question… I want to smooth out the sharp edges. I got it in the GMIC plugin v1.6.5.2 for GIMP using filter Repair → Smooth [diffusion].
Is there an equivalent of Smooth[diffusion] for GMIC in command-line?
For example I mean: ./gmic -input source_img.png -smooth_diffusion 0.70,0.30,0.60,1.10,15.00,8 -output result_img.png
Or maybe there’s another way to smooth edges only? I have tried to use smooth (and blur) + sharpen in command line, but the result is bad.
Screenshot attached:

You can almost always find out what a given command is doing by looking at your gmic file.
For example, in ~/.config/gmic/gimp_update1652.gmic , I searched for ‘[diffusion’, and found this:

#@gimp Smooth [diffusion] : gimp_diffusion_smoothing, gimp_diffusion_smoothing_preview(0)
#@gimp : Sharpness = float(0.7,0,2)
#@gimp : Anisotropy = float(0.3,0,1)
#@gimp : Gradient smoothness = float(0.6,0,10)
#@gimp : Tensor smoothness = float(1.1,0,10)
#@gimp : Time step = float(15,5,50)
#@gimp : Iterations = int(8,1,100)
#@gimp : Sep = separator(), Channel(s) = choice("All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-red chrominances]","YCbCr [blue chrominance]","YCbCr [red chrominance]","YCbCr [green chrominance]","Lab [lightness]","Lab [ab-chrominances]","Lab [a-chrominance]","Lab [b-chrominance]","Lch [ch-chrominances]","Lch [c-chrominance]","Lch [h-chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]")
#@gimp : Sep = separator(), Parallel processing = choice("Auto","One thread","Two threads","Four threads","Eight threads","Sixteen threads"), Spatial overlap = int(24,0,256)
#@gimp : Sep = separator(), Preview type = choice("Full","Forward horizontal","Forward vertical","Backward horizontal","Backward vertical","Duplicate horizontal","Duplicate vertical")
#@gimp : Sep = separator(), note = note("<small>Author: <i>David Tschumperl&#233;</i>.      Latest update: <i>08/27/2013</i>.</small>")
gimp_diffusion_smoothing :
-ac "-gimp_parallel_overlap \"-smooth $6,$1,$2,$3,$4,$5,0 -c 0,255\",$8,$9",$7
gimp_diffusion_smoothing_preview :
-gimp_split_preview "-gimp_diffusion_smoothing $*",$-1,{if(isval($GMIC_GIMP_TIMEOUT),0$GMIC_GIMP_TIMEOUT,8)}

It’s rather dense, but you can see the definition of gimp_diffusion_smoothing basically consists of
-smooth $6,$1,$2,$3,$4,$5,0 -c 0,255.

where the $1 etc represent the parameters shown in the dialog (for example, $1 == sharpness, $2 == anisotropy); So it simply calls -smooth with specified values, and then uses -c (-cut) to limit the output values to the range 0…255.

(The rest of that line just takes care of applying it to the correct channels and calculating it in parallel.)

2 Likes

It works great! That’s what I need! Thank you very much, David Gowers!