Release of G'MIC 2.9

foo:
channel_order=[0,1,2]
repeat 3
echo {($channel_order)[$>]}
done

EDIT: Having to put these parentheses is anyway not cool. I’ve done a small code fix to support expressions as [0,1,2][0] in next version 2.9:
https://github.com/dtschump/CImg/commit/372e1b4ba2e9b84fd91c3d4415f5bc8f78981904

1 Like

Trying ubuntu 19.10 gmic to test this parse_gui command with a json output wish.
Installation works, default output mode is not JSON, the command takes a long time to run, I will not be interested in the ncurses-like-interactive display but just a final stdout/stderr/file dump (even after several runs, is any caching possible on gmic’s side? the parsing takes about 1 minute with json output on my 4 years old or so laptop).
Command line used: gmic parse_gui ,json
Sorry for showing up a bit late for testing this.

Since my target application is a Blender3d plugin, I might interested be in the gmic_image result storage for pseudo-interprocess data exchange.
gmic parse_gui ,json has been running for more than 3 minutes now, either I run that JSON export job in CI/CD chain and include a result .json file inside my plugin, or the JSON loading takes at most 1-10 seconds to run for best user experience :slight_smile:

jd@jd-ThinkPad-T400:~/Downloads$ gmic parse_gui ,json
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Parse '#@gui' filters '*' and output in 'json' mode.
  > Parsing done!                                                   
  >> Generate output, in 'json' mode.
  >> [#220/1076] Black & White/Ink Wash                          ^C

OK I see the gmic image…

jd@jd-ThinkPad-T400:~/Downloads$ gmic parse_gui ,json
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./ Parse ‘#@gui’ filters '
’ and output in ‘json’ mode.

Parsing done!

Generate output, in ‘json’ mode.
Output done!
[gmic]-1./ Display image [0] = ‘n’)‘.
[0] = ‘(’{\n “format_version”: “gmic_(…)on”: “2.9.0”,\n “categories”: [\n’)':
size = (1,2146777,1,1) [8 Mio of floats].
data = (123;10;32;32;34;102;111;114;109;97;116;95;(…),93;10;32;32;125;10;32;32;93;10;125;10).
min = 10, max = 240, mean = 71.7983, std = 37.365, coords_min = (0,1,0,0), coords_max = (0,74124,0,0).

This took about 10 minutes to run… Have I done something wrong? The parse_gui command without parameters takes <5 seconds to run.

@David_Tschumperle, and other G’MIC-people.

Maybe I have an impossible wish/idea:

Is it possible to make a universal filter for shadows, midtones and highlights (with nice overlap setting options)? So we can choose three existing G’MIC-filters, one for each tone seperately, applied at the same time?

For example three different filters:
shadows: Color>Auto Balance
midtones: Color>Mixer [PCA]
highlights: Color>Specific Saturation

Or

For example three the same filters
shadows: Color>Specific Saturation
midtones: Color>Specific Saturation
highlights: Color>Specific Saturation

I understand this is difficult to accomplish in the current GUI setup, but perhaps it is something that can be done in a distant future?

Couldn’t luminosity mask work in those case? It’s entirely doable with GIMP/Krita.

Yes I understand. But I would like to see the effect immediately, at the same time (in the preview).

It is possible to code it in. G’MIC supports dynamic gui.


@David_Tschumperle

foo:
if $1=="8i" e Success! fi #*** Error in ./foo/ (file 'C:\Users\User\AppData\Roaming\user.gmic', line #2) *** Command 'if': Invalid argument '8i==8i': Unrecognized item '8i' in expression '8i==8i...'#

#Even with {}, same error#
foo:
if '$1'=='8i' e Success! fi 

In the math parser, a string must be enclosed between single quotes.
Double quotes has a completely different meaning.

Thanks. One more thing. I noticed gui_split_preview on RGB-Gray Linear Interpolation filter is not right. Why is it behaving like that? If you select a option other than full, it’s not in 50%,50%.

Oh never mind, I simply forgotten the $ next to 14.

Hello @David_Tschumperle

On Windows 10, I am testing:
gmic-2.9.0_pre-cli-win64

It would be possible, in the future, to implement an option to visualize AND compare 2 (or more jpeg images), side by side, while zooming and panning so that both of them are always “syncronized”?

Quite often, before using a G’MIC filter (e.g. for sharpening) I compare 2 or more images, quite similar, because I have shot them with the bracketing method, with a tripod applied to my camera.
Naturally all my jpeg images have got the same exact size (not cropped or anything).

With many applications (e.g. Picasa and the like) you can zoom and pan on many images, at the same time, on ALL images. So that when you zoom in one image the other image is automatically zoomed too. The same applies to pan. When you pan into one image the other image is panned too.

I have just tried to repeat this method with the G’MIC CLI but I gather this option is not implemented yet.
They are correctly visualized side by side, but I don’t know how to zoom and pan to both of them, together.
Unless, I am doing something wrong and it is already possible…

BTW, this option is available with Digikam but not with Darktable or RawTherapee.

What about “gmic image1 image2 a x d” ?

Thanks for the tip: just tried this new command (a x d).

Just tried to zoom with my mouse.
The first image (on the left) is zoomed but the other on the right disappears (no longer visualized).
More precisely, If I am zoom on the upper right position of the first image the second image should be zoomed too. The end result is that I can visualize both upper right parts
Perhaps, I am doing something wrong with my mouse…

With Picasa (and the like) both of them are always visualized so that I can check them (e.g. to look for the different exposure, sharpening etc)
E.g:

You are right, the whole newly joined image (a x == append x) is zoomed, not any selected window. Hmm, I think for the simultaneous display there is some programming necessary!

Perhaps David considers this as a help- and senseful addition?..?

What I do usually for this, is stacking the images as a volumetric image with two slices, and use the mouse wheel to toggle slices:

$ gmic image1.jpg image2.jpg a z 

But @Silvio_Grosso is right, having the two images side by side could be also useful.
It can be possible to write some G’MIC commands to do that, I’m still unsure about the time it will take :slight_smile:

Hello @David_Tschumperle

Thanks a lot indeed for replyting and considering to, maybe, add this new option in some future version of the G’MIC CLI.

This option to compare together some images of the same size is available in all commercial softwares (Capture one, Lightroom, On1 Photo Raw etc). Therefore, I suppose it has been deemed useful by them as well :slight_smile:

Lately, it has even been proposed for ART (the fork of RawTherapee, by Alberto Griggio):

At present, you get this option with Digikam.

At work I use it quite often. E.g. to compare the RAW and the Jpeg of the same image.

For pixel to pixel comparison same size images the difference “-” or absolute difference “- abs” is helpful. At least I am using this mostly just for minor deviations (e.g. jpg and heic)!

I think I’m going to love the fractal tree. That being said, to what extent it is possible to mimic this filter - Dryad - Trees,Flowers,Fractals (Update 30th July 2014) - Plugins - Publishing ONLY! - paint.net Forum ?

I’ve started implementing an extension to the command display2d (aka d2d) so that when a volumetric input image is selected, each slice is displayed on different display windows, with synchronized moves. Up to 10 images can be compared simultaneously.
This is still experimental and prone to improvements, but this is a first trial.
You can test it like this:

$ gmic update
$ gmic sp lena,leno +b. 5 a z d2d

For the moment, you can only interact with the ‘first’ window. I’ll try to improve that in the future.

THANKS a lot indeed!

Tried your same command after updating and it works great.
IMHO, for my personal needs, it is already a great improvement since I can already zoom and pan.

Now my final question…
How can I open just 2 single images?
What am I supposed to type ?
I have tried to modify your command but I am unable to visualize only my 2 images…

For two ima[quote=“Silvio_Grosso, post:120, topic:16755”]
Now my final question…
How can I open just 2 single images?
What am I supposed to type ?
I have tried to modify your command but I am unable to visualize only my 2 images…
[/quote]

For two images:

$ gmic image1.jpg image2.jpg a z d2d