G'MIC QT Plugin Interface

Support for outputting multiple layers was recently added to the standalone version, see gmic-qt/STANDALONE.md at master · c-koi/gmic-qt · GitHub.

I tested this right now.
But it doesn’t work here, like mentioned:

Save the expected output layers in layer_0.png, layer_1.png, …
./gmic_qt -o /tmp/layer_%l.png -p “Layers/Tiles to Layers” gmicky.png

In my command line, there is --output filename_%1.png. But the result is only one file (Array & Tiles > Montage > Output As > Multiple Layers). And the name is filename_%1.png - %1 is not replaced by a number only.

Those changes are not part of the current 3.1.6 release of G’MIC, but they will be included in the next version.

I noticed that there is a prerelease 3.2.0 and tested.
The input of several layers works fine in this version.
But output with --output filename_%f.png doesn’t work.

Why using %f and not %l:

--output filename_%l.png

Sorry, I wrote it the false way.
I tested in the correct way

--output filename_%l.png

but it didn’t work.
Should it work? If so, perhaps I did something else incorrect.
I tested with two images, used “Array & Tiles > Montage” and setup “Output As” to “Multiple Layers”.

I just tested this command:

./gmic_qt --layers --output /tmp/filename%l.png gmicky.png lena.png

With the filter “Array & Tiles > Montage” and “Output As” to “Multiple Layers”

and it works.

I tested again from command line to avoid problems with PhotoLine. But the result is still not correct.
gmic_qt --layers --output test%1.png 01c.jpg 02.jpg
results in one output file
test%1.png instead of test1.png and test2.png
Perhaps the downloadable prerelease doesn’t have this feature?

Well, did you really type test%1 ? %1 is not a valid option, did you mean %l ?
See: gmic-qt/STANDALONE.md at master · c-koi/gmic-qt · GitHub

OK, my fault. I didn’t read it correct. “%1” is not the correct option, it should be “%l” not the number one, but the letter l like “Lima”.
Thank you for your help, now it works.

1 Like

We had a look at this today again.
Since we plan to send the source images to G’MIC and load the result automatically, we have to know when G’MIC is ready.
This is not so easy since G’MIC could be fast or not. When PhotoLine tries to load the result, it doesn’t know if all files are ready.
I think in case of the “%l” (why is it “%l” and not “%d” as in C?), it would be helpful if the last file could have an “end” added. For example, the output files would be test1.png, test2.png, …, testend.png.
This way the calling program would see that it can start to load.

l as layer.

It’s a bit strange. G’MIC is ready when the process returns. It’s that simple.

Looks like a quite ugly hack to solve a problem that could be solved in another way (wait for the process to finish).

It’s not so easy to detect the process is finished.
And if the user doesn’t end G’MIC QT, but presses “Apply” (I think so, in German it’s “Anwenden”), the process is not finished.

Why that ?

In that case, I doubt the images should be already transferred back to the hosting software.
The transfer should occur when the user has finished editing his pictures with the plug-in
(after applying one or several filters).