G'MIC QT Plugin Interface

The plugin interface of G’MIC QT is now reduced to 2. There is the 8bf plugin, which is wonderful, everybody can use it without much effort to install.
The second is the Gimp interface. This has the advantage, that it can create layers, for example for the “Array & Tiles” filters.
Users of our PhotoLine program want to have this feature, so I think it would be useful, to support the Gimp interface. But I can’t find out the way Gimp communicates with the plugin. Can you helf me?

You can look at the code of the GIMP interface, here : https://github.com/c-koi/gmic-qt/blob/master/src/Host/Gimp/host_gimp.cpp

OK, I think it will not work like this. I thought Gimp calls gmic_gimp_qt.exe with some parameters. But now I think it loads libgimp-2.0-0.dll and this has hundreds of functions. No way to support this.
A exe with an image file, for example in TIFF format to have layers enabled, would solve my problem.

Indeed, GIMP defines a complete plug-in API (that G’MIC uses for its plug-in).
If you want to call the G’MIC plug-in executable with some parameters, then look at the “stand-alone” version, that can offer this possibility:

Looks good. I tested it.
A problem is, that I can’t set the output file path. It is saved in the folder of the calling application (PhotoLine) here on Windows. It should be saved in the path of the input files - OK, it’s a problem if they are from different locations. Perhaps -o could set the path - at the moment it looks like not working this way. Or an extra command for the output path?

Second problem. If I send more than one input file, it should be used for one filter (there are filters that need more than one image). But at the moment G’MIC handles the images one after another.

The standalone version of G’MIC-Qt only accepts one input image for each filter.

I doubt that the Qt library TIFF handler includes layer/multi-page support, but I may be wrong.

The original reason I changed the 8bf plugin to use a custom image format is that I discovered bugs in the Qt PNG codec when reading some images, but it also allows for various optimizations when sending images between the 8bf plugin and G’MIC-Qt.

The output file path should probably be a folder, some G’MIC filters (e.g. the filters in the Sequence category) will generate multiple output images.
Other filters can resize the output image, so your application would have to handle that case as well.

In conclusion: None of the disadvantages of 8bf filters can be solved with the standalone version at the moment.

There is a new feature added yesterday that allows to specify multiple inputs for a single filter :

Tested this right now. I used the G’MIC for Windows - Other interfaces latest dev (sorry, but with Windows Visual Studio it’s not so easy to build the project).
My syntax is:
gmic_qt --layers secondLayer.png --output %f mainLayer.png
When I start it, I get an “FileNotFound” error in PhotoLine.
Is my syntax not correct?

As far as I understand the new --layers option, you have to combine your input files to one two-layer image!

Syntax is:

gmic_qt --layers colorful.png landscape.png 

Here, colorful.png is the first (top) layer, and landscape.png the bottom layer.

Yes, I found out this from the source code. But it still doesn’t work here. I tested it from command line, too. But it won’t work. On Windows I don’t get an error message, so I don’t know how to find the problem.

Have you recompiled the gmic-qt binary on windows ?
This new feature requires a new binary. I won’t be able to post a 3.2.0_pre binary before next week BTW.

No sorry, I see no way to do it here in Visual Studio. I used the
G’MIC for Windows - Other interfaces latest dev
version.

OK, started G’MIC with one image and see it’s version 3.1.6

To test GMIC_QT with several layers here is an archive for 64bit Windows:

https://github.com/GreycLab/gmic-community/releases/download/GMIC-3.1.6/gmic_qt-win64-20220907.7z

35,5 Mb (37 324 627 bytes)

1 Like

Thank you. I tested this right now and everything works fine.

What’s about output. If I select “Output as Multiple Layers”.
Are there plans to support this?
In my tests, the one and only working file format is PNG. If I send a TIFF, WebP, SVG, G’MIC doesn’t read it. So file formats that support multiple layers are out of the game.

G’MIC-Qt is not compiled with TIFF or WEBP support, in Qt5 those formats are supported using optional plug-ins. Also, the Qt implementation of both formats can only write a single image.