Release of G'MIC 2.0.0

Hello there,

I’m really happy to announce the release of a new major version (numbered 2.0.0) of the G’MIC image processing framework. As always, I encourage upgrading to this new version as soon as possible :innocent:.
This version got major changes and improvements and is not backward-compatible with the previous branch (1.7.x). From now on, addition of new filters and bug fixes will be done only for this new branch 2.x.x.

What is G’MIC?

G’MIC is a full-featured open-source framework for image processing. It provides several different user interfaces to convert/manipulate/filter/visualize generic image datasets, ranging from 1d scalar signals to 3d+t sequences of multi-spectral volumetric images, thus including 2d color images.

The following is the full Changelog of the version 2.0.0, as compared to the previous stable version 1.7.9.
Enjoy !

New features:

  • [global] G’MIC has new Qt-based interface for the plug-in. This plug-in interface has now its own API, to ease its integration in other host software interested by the G’MIC capabilities. Already work as a GIMP plug-in, and as a stand-alone application, but more hosts should be considered in the future (with a priority for Krita).
    This is a tremendous contribution from my colleague, researcher Sébastien Fourey working at the GREYC laboratory in Caen.

  • [gimp] New filter Deformations / Conformal maps allows to deform images with conformal maps, i.e. warpings that preserve angles locally.

  • [gimp] New filter Black & White / Colorize lineart [smart coloring] proposes a new algorithm to help colorizing lineart images. It uses smart techniques to analyze the geometry of the strokes to close holes in contours before the region filling process. David Revoy wrote an article about it : Tips for using Smart-Coloring GMIC filter - David Revoy

  • [gimp] New filter Various / Sample image proposes several free-of-use reference images to play with.

  • [gimp] New filter Colors / Color mask [interactive] that proposes a smart interactive tool to create color/luminosity masks from images, based on a simple machine learning algorithm.

  • [core/gimp] New command -blur_bloom and associated GIMP filter Degradations / Blur [bloom] that creates a glow effect on your images, using the method of Masaki Kawase:2004 (same as the Bloom plug-in in Natron).

  • [core] 3d renderer in G’MIC is now able to map bumped textures on 3d triangles/quadrangles, when illuminated wit Phong-shading.

  • [core] New native command -for allows to create loops as -for condition... -done (with the condition being evaulated before the first iteration of the loop, contrary to a -do...-while condition block).

  • [core] Unary operator% added to math parser, to compute percentage of expressions (e.g. x=10;(100-10)%).

  • [core] Function bool() added to math parser, to cast a value into a boolean (0 or 1).

  • [core] Function resize(#ind,w,h,d,s,interp,boundaries) in math parser allows a math expression to resize an image of the image list. This is a flexible way for a complex expression to manage variable length buffer/vectors (such as value stacks for instance).

  • [core] Function end(expr) in math parser allows to insert termination code into a math expression, useful for instance when multi-threaded evaluation is performed on an image.

  • [core] Function _(args) in math parser added. It does nothing else than ignoring its arguments. Useful for debugging expressions.

  • [stdlib] Add new blending modes shapemin, shapemin0, shapemax and shapemax0 that computes the min and max values of the base layer over continuous regions in the top layer.

  • [stdlib] Add new blending modes shapeareamax, shapeareamax0, shapeareamin and shapeareamin0 that keep the most frequent color of the base layer over continuous regions in the top layer.

  • [stdlib] New commands -rgb2hcy and hcy2rgb converts color from/to RGB to/from HCY color spaces.

  • [stdlib] New command -apply_matrix3d applies a 3x3 matrix to a 3d vector object.

  • [stdlib] New command -extract_region extracts all pixels from selected images according to the labels of another image.

  • [stdlib] New commands -display_parallel and -display_parallel0 (eq. to -dp and -dp0) displays multiple images on different interactive windows (-dp0 does it without value normalization).

  • [stdlib] New command -x_connect4 implements the famous Connect-Four game. Available also in the plug-in, in filter Various / Games & Demos.

  • [community] G’MIC has now its Twitter feed, at https://twitter.com/gmic_ip.

Improvements / Changes:

  • [other] Compilation of G’MIC on Windows 64bits now uses a recent version of g++ (6.2.0), which makes a huge difference in performance for some filters (e.g. x60 faster for image deformation with conformal maps).
  • [core] Added OpenMP parallelization in function used to display list of images, and compute image statistics.
  • [core] Added support for 64bits-valued .tiff files (including integer and float formats).
  • [core] Native commands -resize, -crop, -warp, -shift -rotate and -map now accept a boundary_condition argument that can be =3 (for mirrored boundaries). This includes pixel accessors in the math parser and most custom commands using boundary condition arguments as well.
  • [core] Command -shift has a new parameter interpolation = { 0 =nearest-neighbor | 1 = linear }.
  • [core] Command -boxfilter now accepts an additional nb_iter argument which allows to run the filter multiple times without using an explicit loop (is really useful and runs significantly faster).
  • [core] Math parser now accepts multiple init() calls in a single expression.
  • [core] Math parser now accepts multiple consecutive separator ; inside an expression body.
  • [core] Bitwise operators and, or and xor in math parser now use signed values for computation.
  • [core] Command -flood now supports high-connectivity when applied on 3d volumetric images, and requires less memory to run.
  • [core] Command shorcuts for matrix multiplication and divisions are now -m* and -m/ instead of -** and -//.
  • [core] Matrix multiplication in math parser cannot be done with operator ** anymore (reserved for multiplying complex numbers).
  • [stdlib] Comment tags #@gmic, #@gimp and #@gmicol used in the .gmic command files have been replaced respectively by #@cli, #@gui and #@web.
  • [stdlib] Command -map_clut now accepts the clut name directly as a parameter.
  • [stdlib] Command ‘-sample’ now accepts multiple image names as parameters.
  • [gimp] Preview warning due to changed zoom factor now appear as a small icon under the preview window, rather than a note in the filter parameters.
  • [gimp] The plug-in for GIMP gmic_gimp now registers itself in a way that several version numbers of the plug-in can coexist.
  • [gimp] New CLUTs to emulate Fuji films have been added, kindly provided by Stuart Sowerby.
  • [gimp] Non-interactive call of the plug-in has now an additional ‘output-mode’ parameter.
  • [web] Our online web service G’MIC Online has a new beta version, that should work better on mobile devices. G’MICol beta is developed by Christophe Couronne, a member of the GREYC laboratory in Caen.

Bug fixes:

  • [core] Fix argument parsing for command -ellipse, so that specifying ellipse radii with percentages do not disable outlined drawing.

  • [core] Fix argument parsing for command -window, so that specifying -window without window indice always displays the image in the window #0 (was in last window indice invoked before).

  • [core] Fix 3d rendering bug that may happen with close 3d objects having quadrangles.

  • And as usual, a lot of small bug fixes !

10 Likes

For Mac users: there is a VERY experimental gmic_gimp build from git, linked against GIMP.org built Gimp 2.8.18 without parallel support, ffttw, curl and display under http://karo03.bplaced.de/gmic/git/gmic_gimp%20for%20Gimp.org.zip

At least on my machine with MacOS 10.12.1 the plugin was functional!

2 Likes

@David_Tschumperle,

I downloaded G’MIC for GIMP 1.8.0pre#122116 (Windows 10 64bits)

How can I use my own filters? G’MIC doesn’t show them anymore.

They are in …\AppData\Roaming

Do I have to change something in my user.gmic file?

Edit: I replaced “gimp” with “gui”
and “gmic” with “cli”

I hope everything works, The filters do show up now

Edit2: Some filters work, but others don’t work.
Can you please give more instructions what to change?

What does xor now using signed mean exactly? Usually bitwise doesn’t care about sign, only the number of bits. In the end it doesn’t matter to me apart from using it for xorshift pseudo random (it’s faster for some things where I don’t care too much about period etc.:

gcd_rand : -skip ${1=1},"${2=?}"
  -f "init(a=int(255*u);b=int(64000*u+999);q=int(255*u+255));
      n=xor(a,a<<13);a=b;b=q;q=xor(xor(q,q>>15),xor(n,n>>10))"
  -if {isval("$2")} -n $1,$2 -else -n 0,$1 -endif

will this sort of thing still work (it does seem to in testing with x64 1.8.0 pre)?

Having a signed xor does not change a lot, except that the result can be signed too, for instance, xor(-2,-1) returns -3.
In any case, this was a bad idea to apply these bitwise operators to unsigned long types in the math parser, as at the end, the result of these operators must be cast to a double value. This was causing strange things, such as 1 | -1 resulting in double_max for instance. Not very practical and source of bugs in math expressions :slight_smile:

Hello iarga,
You are right, this change is needed. The benefit is that filters written with #@gui will be also available in the universal plug-in, planed for the next release 1.8.0 of G’MIC. This is intended to be a plug-in that can be compiled for different hosts, namely at least GIMP and Krita (as well as a stand-along application).

Which filters do not work ? Please let me know, as I’ve just made that change, and there are certainly some regressions to fix.

OK thanks that explains it indeed :slight_smile:
It still seems to work with the script above, no reason that it shouldn’t so long as it’s kept within a certain number of bits anyway.

I have problems with some of my own filters. Most are original G’MIC filters I changed a bit. First I want to try to understand what’s going on. I will check the original filters. there is a new color space. I know sequence is important in the code. Maybe that gives some errors too. (edit: it doesn’t) So I first want to try to fix the errors myself. I can learn from that.

If there is a problem with a G’MIC filter, I will report it to you.

edit: At first sight, all filters work correct.

edit2: I now see that:
#@gimp Boost-fade : gimp_boost_fade, gimp_boost_fade_preview
changes in:
#@gui Boost-fade : fx_boost_fade, fx_boost_fade_preview

and:

-gimp_split_preview "-gimp_boost_chroma *",-1
changes in:
-gui_split_preview "-fx_boost_chroma *",-1

Now I have almost all my own filters working. :slight_smile:

@David_Tschumperle

Could you please give an explanation about; when to use “gui” and when to use “fx”?

example:
was:

gimp_unsharp_goldmeinel:
-ac "-gimp_parallel_overlap \"-_gimp_unsharp_goldmeinel $*\",$7,$8",$6,1
_gimp_unsharp_goldmeinel :
-deblur_goldmeinel $*

now:

fx_unsharp_goldmeinel:
-ac "-gui_parallel_overlap \"-_fx_unsharp_goldmeinel $*\",$7,$8",$6,1
_fx_unsharp_goldmeinel :
-deblur_goldmeinel $*

Samj,

I like your new color haromonies filters. :+1:

iarga, commands that apply filters on image and that showe name were starting with gimp_ now usually starts with fx_ (most commands), while commands related specifically to the GUI, starts with gui_ (only a few).

@iarga
Since you’re already on 1.8 this might be of note: “tone enhance 2” now has an additional slider (after filter refresh) to allow greater shadow/highlight adjustment, using a non-gamma curve (it’s based on inverse quadratic).

Hopefully I’ll be able to replace original tone enhance eventually, I’d rather not maintain two versions. There’s more to be done though; I still need to make detail smoothing scale-invariant…

1 Like

Just discovered something which broke some filters (easily fixed though) - the gui option “const()” has been changed to “value()”. Maybe this was documented somewhere, if so I missed it!

You are right Andy :slight_smile:
The documentation is somehow there (on the beginning of the gmic_stdlib.gmic file, but not very easy to find).
Note that it doesn’t really “break” anything, as the version 1.8.0 has not been released yet :slight_smile:
Thanks for your fixes !

@iarga
Tone enhance 2 now has scaled detail smooth, gaussian blur seems to be good enough. For anyone interested, I discovered a “cheap” way of doing edge flow along the way:

test_edge_warp : -skip ${1=20},${2=0.1}
  -repeat $! -l[$>]
    --structuretensors -eigen. -rm.. -mix_channels. (0,-$2;$2,0)
    -repeat $1 -warp.. .,1 -*. -1 -done -rm.
  -endl -done

It has some interesting effects when the second parameter is set above 1 :slight_smile:

1 Like

@garagecoder,
I played with it a short time. I’m impressed. Very nice. Less halos , less artifacts, nice smoothing. More color spaces.
As I said earlier; it is also a very good dehazer!!!

As for me, you don’t have to maintain two filters.

Is it possible to have more iterations within this filter? (I don’t know, if this is a strange question. :wink:)

@iarga
This is good news :smiley:
I just finished tidying it up, you’ll probably need to refresh filters again. There’s a new option for color channel median (mainly for compressed images where dark/light areas can have color artifacts).

When you say iterations, I assume you mean repeatedly run the entire filter? At the moment there’s no loop so just one iteration. I could add that I suppose, but not sure how useful it would be!

@garagecoder,

Color median works fine.

Your whole new tone enhance filter is more subtle.

Yes for iterations I mean repeatedly run the entire filter. Sometimes it is fun/useful to have extreme possibilities, far beyond nice and subtle :smiling_imp:. (As with other detail filters)

@garagecoder,

Such an awesome filter at the end of the year. Thank you very much.