On the road to 3.0

Here I will write about the advances made from latest stable version 2.9.0 to next major version 3.0.0. Right now, I expect mainly bug fixes and a few new features (but the less native possible, to keep compatibility with 2.9.x).

From 2.9.1 to 2.9.2



From 2.9.0 to 2.9.1

New features:

  • [gimp-qt-291] New filters Various / Import RGB-565 File and Various / Export RGB-565 File allows to import/export data from raw RGB-565 files.


  • [gimp-qt-291] New API feature allowing to hide unused items or comboboxes for hosts that don’t implement all the plug-in features.

  • [core-291] New command remove_named (shortcut rmn) removes images with specified names from the list (equivalent to rm[${"-nmd name"}]).

  • [core-291] Interactive 3D viewer (command display3d, a.k.a d3d) has been recoded from scratch as a custom command.

  • [core-291] New substituting expression {*,f} returns 0 or 1 whether the display window is in fullscreen mode or not.

  • [math-core-291] New function swap(a,b), swaps the values of given arguments a and b.

  • [math-core-291] New functions vargkth(), vargmin(), vargmax(), vargminabs(), vargmaxabs(), vavg(), vkth(), vmin(), vmax(), vminabs(), vmaxabs(), vmed(), vprod(), vstd(), vsum() and vvar() are similar to the functions whose names do not start with v, but works with vector-valued arguments (and return a vector-valued result).

  • [math_core-291] New function string() creates a string from a list of arguments (similar to echo() but outputs a vector).

  • [stdlib]-291] New command rbf computes interpolated 1D/2D/3D functions from a set of sparse keypoints.

  • [stdlib-291] New command percentile applies a “percentile filter” to selected image (mix between averaging and dilate/erode/median).

  • [stdlib-291] New commands input_565 and output_565 allows to read/write images files in raw RGB565 format.

  • [stdlib-291] New command is_macos returns 1 or 0 whether G’MIC is run on MacOS or not.


  • [core-291] Commands solve and invert now runs in parallel when possible (also apply for functions solve() and inv() in the math parser).

  • [core-291] Special input string (value1{,|;|/|^}value2{,|;|/|^}...[:{x|y|z|c|,|;|/|^}]) has now an optional :axis option to unroll the image values along a specified axis.

  • [core-291] Slightly improved the memory footprint of the G’MIC interpreter. A few memory allocations are avoided when not necessary.

  • [core-291] Variable font size are now used in interactive viewer when displaying a list of image (command display), in order to make it readable on HDPI screens.

  • [core-291] Optimize commands isoline3d and isosurface3d, by lowering the number of grid points evaluations.

  • [core-291] Better support UTF-8 paths and filenames on Windows.

  • [core-291] Command uncommand now has a shortcut name um.

  • [math_core-291] Add a pre-optimization step that detects common simple expressions for speeding up evaluation for these cases.

  • [math_core-291] Change encoding of unsigned int values in functions f2ui() and ui2f(), so that no subnormal float numbers are used for the encoding. This avoids issues for commands dealing with large 3D objects, when aggressive optimization flags are used for compiling gmic (which is the case by default).

  • [math_core-291] Improve syntax for accessing a vector component, where the left side of the [] operator is complex. For instance, I[#0,off][2] is now recognized (needed parentheses before, i.e. (I[#0,off])[2]).

  • [stdlib-291] Command display2d: font with adaptive size is now displayed in order to deal with hidpi screens.

  • [stdlib-291] Command display2d: hexadecimal display of color values is now enabled for 1,2,3,4-channel images (not just 3 as before).

  • [stdlib-291] Command sort_list has been optimized when used with the n type of sorting.


  • [core-291] Fix a few (critical) OpenMP issues with clang++ compiler.

  • [core-291] Fix possible buffer overflow happening when reading some malformed .bmp files.

  • [core-291] Substituting expressions s.a. ${"command"} now checks that the provided command does not change the number of images in the list, and throws an error otherwise (was possibly leading to segfaults, e.g. sp lena +b 10 d ${"max u 10"} ).

  • [core-291] Fix argmax command and argmax() function in math parser (regressions introduced in 2.9.0).

  • [math_core-291] Fix modulo function when called with inf or nan values.

  • [math_core-291] Fix function isint() when passing NaN or inf values.

  • [stdlib-291] Fix filter Artistic / Cutout (regression of 2.9.0).


– FYI, Apple dropped the X. It is now macOS.
display0 no longer shows stats like other display modes.
sqr() function missing in docs.

Hello everyone

I was replying to a post on this forum about an user request to reduce red-eyes:

In order to help this user I have downloaded from Internet a picture with the problem (red-eyes, I mean) :slight_smile:
I have discovered that with this very particular PNG image the G’MIC 2.9 GUIs is not available with GIMP 2.10.18 (Windows 10 - 64 bit). It is greyed out and you can not click on it.

The 2.9 CLI version of G’MIC works fine with this same image. Therefore I don’t know whether it is a “bug” of GIMP or G’mic (Qt graphical version…).
As reported this problem occurs only with this png file. The other PNGs images work fine in that the GUIs is always available with GIMP.
In addition, if I save this same image as jpeg the G’MIC plugin is working on GIMP.

Here is the image:


This .png is not in RGB mode, but uses indexed colors. In GIMP, go to ‘Image -> Mode’ and select ‘RGB’ to be able to open the G’MIC plug-in.

Hello @David_Tschumperle

This .png is not in RGB mode, but uses indexed colors.

I would have never thought about that :slight_smile:

Just tried again your suggestion. It works great now!
Thanks a lot indeed!

Hi, nice progress with display3d as custom command. Still actually, on my Mac I get an error

gmic osteo elevation3d 0.2
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Load osteoblast nucleus example image
[gmic]-1./ Build 3D elevation of image [0], with elevation factor 0.2.
[gmic]-1./ Display 3D object [0] = ‘osteo’ (16384 vertices, 16384 primitives).
[gmic] *** Error in ./display3d/_display3d/(…)/*if/boundingbox3d/*repeat/*local/ *** Item substitution ‘{o3d.>0}’: Unrecognized item ‘o3d.’ in expression ‘o3d.>0…’.

It disappears with
gmic m work/src/gmic/src/gmic_stdlib.gmic osteo elevation3d 0.2

There is seemingly a mismatch between cmic_stdlib.gmic and update291.gmic

Indeed, I’ve just noticed that boundingbox3d was already defined as a command in jerom_boulanger.gmic (from @Jerome_Boulanger , with a different way of using it.
I’ll see what I can do to fix that.

Very good. Still I have a problem to add a background image. I tried

gmic m work/src/gmic/src/gmic_stdlib.gmic osteo elevation3d. 0.2 follic d3d… .

Are there any conditions for the background image?

Actually, I didn’t take care of the previous list of possible arguments for d3d.
I’ll manage them ASAP.

Bug or misunderstanding?

gmic (-28) (-14) +argmin +argmax.. # unexpected (argmax!=1)
gmic (28) (14) +argmin +argmax.. # expected

gmic (-28) (-14) +argmin +argmax.. # unexpected (argmax!=1)
  • The first +argmin is equivalent to +argmin[0,1] and returns then (0) as -28<-14.
  • You have then a list of 3 images : (-28), (-14) and (0).
  • The +argmax.. is then equivalent to +argmax[1] and returns (0) (obviously , there is only a single image in your selection, so 0 is the only possible value that can be returned by your argmax).

I’m not sure what you wanted to compute with your argmax, actually.

Typo. The same result comes from

gmic (-28) (-14) +argmin +argmax[0,1] e[] {2,i},{3,i} q # 0,0

That is more unexpected indeed. Will investigate this tonight :slight_smile:

That was a bug indeed! I’ve fixed it.
I guess nobody should use argmax until the next release 2.9.1… :frowning:

I have a large list of images. If errors appear anywhere in this list it is quite difficult to trace that. Especially if the error appears only inside the long list processing and not on the finally isolated image. In fact I had a crash of such sort setting a parameter with or without “%” and could not prepare information to trace that bug. Hence I could not send a bug report.

I think some sort of break, debug or stop/continue function inside the actual environment allowing to insert and process additional gmic commands would be very helpful.

I don’t really understand what you mean here. Do you have a simple example of code that reproduce your issue?

That is just the problem. I had some 300 images calculated in a sequence and one, say the 170th delivered a crash. However trying this image alone with the same sequence, there was none. I could not isolate a small piece of code with the issue.

What kind of crash ? Did you get any error message ? What was the command applied ?

I cannot reproduce it now!

Message was

[gmic] G’MIC encountered a fatal error. Please submit a bug report, at: https://github.com/dtschump/gmic/issues

The last image processed was an extracted region, actually the “L” channel from “rgb2lch”,

[14] = ‘trans_c1’:

size = (1,367,1,1) [1468 b of floats].

data = (94.0206;94.1174;93.8031;94.2977;92.6694;91.849;92.816;93.6015;92.8939;91.4756;91.1697;91.581;(…),92.3684;94.1638;92.2279;89.4571;89.2402;91.0791;92.9231;91.7553;90.0086;90.1253;91.3168;93.0702).

min = 81.0405, max = 99.4728, mean = 92.1273, std = 3.58977, coords_min = (0,169,0,0), coords_max = (0,284,0,0).

and the command was “karo_extinction. ,” which defaults to 100%

The crash disappeared with “karo_extinction. 100”

In the meanwhile (continued work), there is no crash anymore neither with 100% nor 100

Sorry not to be more specific!

The first occurrence was:

/Users/karo $ gmic bh_praep ,,,,269
[gmic]-0./ Start G’MIC interpreter.

[gmic] G’MIC encountered a fatal error. Please submit a bug report, at: https://github.com/dtschump/gmic/issues

“bh_praep” is a custom function from me, processing a set of images with lots of called other functions.