On the Road to G'MIC 3.8

This is the running changelog, that will be regularly updated until the release of the 3.8 version of the G’MIC software.

It lists all new features and changes done since latest stable version 3.7.0 (so, all versions between 3.7.1 and 3.8.0, included).

New features

G’MIC-Qt plug-in:

  • [gmic-qt-371] New filter Artistic / Marker Drawing applies a marker drawing effect on selected images.

G’MIC Standard Library:

  • [stdlib-371] New command unitnorm computes the pointwise Lp-norm in selected images.

Others:

  • [web-371] Added a new code sample “Rotating Diffusion-Limited Aggregation”, in the Gallery section of the G’MIC website.

  • [emacs-371] Created a gmic-mode.el file, that defines a G’MIC mode for Emacs : Automatic indentation and syntax coloring for G’MIC scripts.

Improvements / Modifications

Core functionalities:

  • [math-core-371] New pre-defined variables _0 and _1 which are vectors whose dimension is equal to the number of channels of the associated image, and whose values are all 0 or 1.

  • [math-core-371] Optimization of vector initializers, with smaller generated opcodes.

Bug fix:

  • [core-372] Fix UB in G’MIC interpreter, caused by trying to unlock a mutex that has not been locked before.

  • [core-371] Fix line drawing algorithm bug happening when specified line coordinates are very large (out-of-image), but a when portion of the line should be drawn anyway in the image.

  • [math-core-371] Variable $% were returning NaN in a single-iteration loop, when accessed through the math parser. Now returns 0 .

  • [math-core-371] Variable $var were returning 0 instead of NaN if $var was as a string rather than a number.

  • [math-core-371] Fix bug in SVD computation that was computing wrong singular values in some cases. That was affecting the functions svd() and eig().

1 Like

What would I use null for?

A typical use is to tell eval to perform the image loop only over axes x,y,z, and not all axes x,y,z,c.

Example: The following code will produce a binary image that has values 0 or 3.

$ gmic sp colorful 100%,100% eval.. "max(I>128)?++i(#-1,x,y,0,0)"

Whereas, this one:

$ gmic sp colorful 100%,100% eval.. "max(I>128)?++i(#-1,x,y,0,0); null"

will produce an image that is either 0or 1.

(It’s equivalent to : $ gmic sp colorful 100%,100% eval.. "max(I>128)?++i(#-1,x,y,0,0); I" , but null costs nothing, while I takes one operation per pixel).

I see, so, in that case, wouldn’t it makes sense to replace I with null? I think I’ll do that in my code when I get to doing it.

Yes, it would make sense.
What I do sometimes, to avoid putting I; at the end of the fill or eval expression, is add a begin(ret = vectors()) section at the beginning of the expression, then use ret as the very last item of the expression.
But null will simplify this.

Got it. This does raise a question though. I haven’t tested it yet, but this should work fine?

if(const_variable
,do_something(); # const_variable is true, then do something
,null;           # Otherwise null
);

EDIT: Looks like I can’t test it unless I compile. So, when’s the prerelease repository is going to be updated?

It’s already there, in branch develop:

I mean here: Index of /files/prerelease

Now that’s just too cool, David. :slight_smile:

@Reptorian , just FYI : I’ve built pre-release binary packages (3.7.1_pre) and uploaded them on the G’MIC server.

@Reptorian , finally there are some changes concerning null.
It is replaced by _0 , which is a vector of 0 , having the size of the spectrum of the associated image. I’ve also added _1, that is the same but with 1s instead of 0s.

1 Like

Doesn’t this affect things like const _0=_'0';?

I use that construct for in case I need int representation of char, and underscore tells me it.

It’s like any other predefined variables, you can ovveride it with your own definition if you want, so const _0 = _'0'; is still valid and working.

1 Like

2026/02/26: Release of G’MIC 3.7.1.

Now taking a short break to recharge, hopefully to be back more motivated!
Enjoy!

1 Like

Haven’t tested much, but had to try the Marker preset, David and it works great. With a bit of Convolution stuff to bring some of the details back, the below is a result. Much improved over my actual capture. lol

:slight_smile:

1 Like

Great job, Lyle!
Honestly, this filter is really becoming my favorite at the moment. It ultimately has relatively few parameters to adjust compared to the wide range of results it can produce.
From an algorithmic point of view, I find that truly remarkable :slight_smile:

re"marker"able for sure, David. lol

:slight_smile:

1 Like

2026/02/26: Release of G’MIC 3.7.2.

Yes, only a few hours after 3.7.1 was released, but I spotted an undefined behavior in the interpreter code, and I really wanted to fix this before any problems arose!
Really sorry about that.

I can’t keep this question out of my head, but do you think 0x$copies can be done in parallel? I think this would be a good idea to improve execution time code that use dictionary structure. Like imagine it can be done in parallel, and instead of low values, you can create 100000+ 0x0x0x0 without it being a bottle neck.