Release of G'MIC 2.1.0

This is the changelog for the release of a new minor version (numbered 2.1.0) of the G’MIC image processing framework. This new stable version stays (mostly) compatible with the previous version 2.0.4. Focus has been put on the improvement of the performances and the simplification of the language syntax.

What is G’MIC?

G’MIC (GREYC’s Magic for Image Computing) 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.1.0, as compared to the previous stable version 2.0.4.
Enjoy !

New features:

  • New command -spherize and its associated plug-in filter Deformations / Spherize.

  • Major change in G’MIC syntax : invoking commands without specifying the single hyphen is now possible when there is no ambiguity on the syntax. For instance, the following command definition is now accepted :
foo : 
  sp lena                        # Eq. to '-sp lena'
  if {im>64}                     # Eq. to '-if {im>64}'
    blur 10                      # Eq. to '-blur 10`
    mirror x                     # Eq. to '-mirror x`
  endif                          # Eq. to '-endif`

This should help making G’MIC scripts more readable, as it avoids a lot of hyphens to be written. Backward compatibility with previous G’MIC scripts is preserved.

  • New demo added in G’MIC demo menu (command x_starfield) :

gmic_starfield

Improvements / changes:

  • The G’MIC script parser has been partially recoded to manage the important changes in G’MIC syntax (single hyphens are now optional). Particularly, the command lookup procedure is really faster (performs in O(log2(N)) instead of O(N)), meaning G’MIC scripts now execute slightly faster, while memory footprint has been reduced.

  • And as usual, a lot of small bugfixes ! :wink:

4 Likes

-spherize

  • You had to choose an unflattering distortion. I am sure this young lady would be pleased :stuck_out_tongue:.

Invocation without a dash

  • This is very useful. I often forget a dash or two when writing one-liners. By far the most common mistake I make :blush:.

It should be possible to use a selfie for the demonstration. A very fine addition, nevertheless, bravo!

Despite the major changes in the G’MIC syntax and interpreter, the pre-release 2.1.0 seems to be stable enough, and backward compatible with the previous syntax.
As the documentation has been already updated on the web site, I prefer to make this pre-release the default download, so that the documentation actually corresponds to the downloaded binaries.

I find the ‘new’ syntax really cool and natural, e.g.

$ gmic sample duck repeat 3 smooth 200,0,1,2,2 done sharpen 300 output output.jpg

instead of

$ gmic -sp duck -repeat 3 -smooth 200,0,1,2,2 -done -sharpen 300 -o output.jpg

(but both are working as expected).

I’m sure this will be more appealing for people like @patdavid :wink:
Do not hesitate to test and tell me what you think !

  • 2017/10/09: Final release.
    :wink:

@David_Tschumperle

gmic sp lena avgc=${-average_color} q

works but

gmic sp lena avgc=${average_color} q

doesn’t. Is this a bug? Also, how do you use gcd?

Not a bug, but a possible ambiguity, as ${average_color} also means the same as $average_color (content of a variable). And indeed, in this case, the variable content is substituted instead (this is a most common case).
Prepending a hyphen to the command name removes the ambiguity, as a variable name cannot start by a hyphen, and ${-command} is thus substituted by the returned value of the command invokation.
Other ways can be used to remove this ambiguity, just put a character that is not allowed in a variable name, e.g. ${average_color.}, ${average_color[^]} or even ${average_color\ }.

Interesting. Could you provide an example of gcd? In particular, I would like to calculate the gcd from the dimensions of an image. Thanks!

I’d say this should work, for an image named img

gcd=${gcd[img]\ {[w,h]}}
1 Like

Oh, I forgot to escape the space!