Release of G'MIC 2.8

Maybe $$command might help you?

gmic e $$gradient_norm
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ e[^-1] “Compute gradient norm of image$?.” repeat ! l[>] g sqr s c + sqrt endl done
[gmic]-0./ End G’MIC interpreter.

Still it is only helpful for custom commands, internal commands show no output (like gradient), there is no script!

1 Like

Website issue. When I key in, I sometimes go to and then Firefox warns me about an insecure connection. Looks like the website sometimes resolves to http instead of https.

Any chance of a short example for ?

@zyx Welcome to the forum! @David_Tschumperle is just getting started. I would also like an example when it is ready for one.

Bug hunting Both have (no arg) options:

gmic + r=1

works but

gmic sp r=1



New in 2.8.1 :

As you may know, G’MIC defines its own script language and embeds the corresponding interpreter. In upcoming version 2.8.1, a special running mode will be added in G’MIC, allowing gmic to implicitly generate an entry point in a .gmic file, so that including such a file with command input automatically runs the code defined in the entry point.

This mode is activated only when gmic is called with a single argument, which is the .gmic file to consider, i.e.

$ gmic test.gmic

In this case, if test.gmic contains some code defined outside the body of some user-defined commands, then it will be considered as a part of a new implicit command _main_, and executed after loading the file.

Moreover, on Unix systems, you can use a Shebang line in test.gmic and make it directly executable (just as you can do it with python or php). For instance, define your file test.gmic like this:

# This file can be made executable.

echo "Starting entry point"
if date(3)==1
  echo[] "\nIt's monday !\n"
  echo[] "\nToday is not monday !\n"
echo "Exiting entry point\n"

And then, on Unix :

$ chmod a+x test.gmic
$ ./test.gmic
[gmic]-0./_main_/ Starting entry point

Today is not monday !

[gmic]-0./_main_/ Exiting entry point

On other systems (that do not support Shebang), you can get the same behavior with

$ gmic test.gmic

You can see in the first and last echo output on the command line that you are indeed running code in a newly created command named _main_.

If you want to debug such a script file, you have to explicitly call _main_', because if you activate thedebug` flag on the command line, you are not in the situation of the special running mode, so:

$ gmic test.gmic _main_ debug

In you are interested, you will find some example of such executable files here :

1 Like
  • 2019/12/19 : Release of 2.8.1.

Well, I asked afre whether it’s possible to blur by image instead. It’s not possible to do $ . blur.. . rm. without errors. I really would like to know what this would look like, and what interesting effect can this give.

For reference - This is how it would look like:

Target Image

Applied Blur by image

2020/01/06 :

[gmic-qt-282] New filter Repair / Unpurple removes purple fringing from photographs. This is a port of by new G’MIC contributor, Stanislav Paskalev.


Hi David,
trying again to make dt use the compressed lut GMIC feature.
I don’t succeed in making the cmake command find_package() retrieve the G’MIC version.
Should that work ? Is there any known issue about this ? Any advice ?
(currently testing on Debian 10).

I’ve really no clues about how cmake work, so I won’t be of great help here, but:slight_smile:
I know at least one way to get the G’MIC version number, with a call to gmic, so it may help finally :

$ gmic v 0 echo_stdout[] \$_version

If you know how to retrieve this result in cmake, then it should be ok ?

This, for instance:

$ VER=`gmic v 0 echo_stdout[] '\$_version'`
$ echo $VER

Thank you for the quick answer. At least we can check the version at run time.

Making progress but …"v 0 echo_stdout[] \\\\$_version");

while"v 0 echo_stdout[] \\$_version");

Any idea ?

So, probably :"v 0 echo_stdout[] $_version");

is OK. I’ve added the backslashes because I was calling this from a bash console.

Great, that works. Just have to redirect the standard console now.

  • 2020/01/14 : Release of version 2.8.2.

David, is it possible to extend quadtree variations even further to create additional quad-like patterns?

Can the math parser multiply whole vectors and perform similar operations? That would be useful for my kaleidoscope layer cake script.

I think you can. Like this? See the vector thread made by @David_Tschumperle.

C Output: 15,16,25