Custom GEGL plugin with G'MIC and SIGSEGV

My curiosity leads me to ask these few questions:

  • What kind of parameters are supported, and which are not ? For instance, I suppose point() must be split into two float() ? Does GEGL supports a color selector (parameter color() )?

  • I assume that having GEGL nodes make G’MIC effect non-destructive inside GIMP. For effects like Drop Water, how does it feel ? Non-destructive means effects are recomputed from time to time and I’m a bit afraid that it could be not fast enough (G’MIC has not been primarily designed with real-time effects in mind).

  • Do you plan to “release” these nodes officially one day or another ? I would be very interested in promoting you (well deserved!) and your work, and sharing this great news on the G’MIC social accounts.

Hi,

  1. Most of the parameters I think are supported :slight_smile: Color works out of the box as it maps nearly directly to Gegl.Color type, I’m not sure about the point() tho - can I ask you to point any g’mic command that uses point() as a paremeter?
  2. I need to say it’s quite fast :slight_smile: Gegl caches the results so as long as you dont change any parameter value it should not re-render anything
  3. Absolutely :slight_smile: I just need to spend some time and verify some of the generated commands and finish implementing support for Aux pad (it could be handy in some blending operations)

For sure I will keep you posted, many thanks for your kind words again :smiley:

Regarding the “non destructive nature” of GEGL operations: as soon as you apply the operation result it is no longer non-destructive, I mean the effect is then applied on your image/layer in gimp as any other filter does.

For instance, filter Deformations / Circle Transform uses point() parameters :

This kind of parameters shows as moveable points on the preview widget.
Technically speaking, they can be replaced by two successive float() parameters that corresponds to percentages along the X and Y dimensions of the previewed image.

I’m so excited :yum:

Oookay, apprently I missed the point() property type :sweat_smile:

1 Like

Okay, implemented point() support :slight_smile:
Surprisingly its… quite fast :>

2 Likes

Does this take into account of persistent variable and dynamic GUI change?

Not for now, probably… it could, but this will involve a bit more of work, not sure tho…

Oh man I have ~850 nodes available, there is too many options and combinations possible now…

1 Like

You can never have too many of them.
https://gmic.eu/gui_filters.txt
List of filters in the G’MIC plugin (1280 filters, 01/12/2025, 15:21:50)

Indeed (without the “About” and “Bush” tags), there are 1226 filters, so 850 is only ~70%. :grinning:

Regarding the use of point() parameters.
It’s probably not possible (or too complicated) to implement, but Gegl also supports control points (aspect ratio).

And some aren’t even meant for filter. Well, that makes up a irrelevant minority. I have a demo filter which is named “Tupper’s Self-Referential Formula” or something like that, and it shows you can definitely process large integers in G’MIC through “trickery”, and it’s just a demo. So, something like 820 filters are actually applicable. Reduce that by some with dynamic gui and _persistent, maybe a little less than 800.

What could be cool is to have a way (a script?) to automatically update/recompile/re-install the GEGL nodes automatically from the filter update file (that is, e.g. https://gmic.eu/plain_update364.gmic).
This file hosted on the G’MIC server is updated from time to time, when an existing filter gets a new feature, or when a new filter is added, as I did a few days ago:

Do you think this would be possible @activey ?

Super-nice work BTW !

puts on packager hat

This should also work during a totally offline build where the gmic filter file is provided on disk.

and pulling new files should not automatically happen without an OK from the user. :slight_smile:

Many thanks! :slight_smile:

My ultimate goal is to have a GitHub pipeline that will build all the plugins against latest G’MIC stdllib and package them in some way that users could fetch it without thinking much about it.

1 Like

You are doing something excellent. Will you add parametric animation features later on, as well as import and export of PNG sequences?

1 Like

@activey , I’ve seen your thread has been shared on Mastodon by @darix:

And reshared by the GIMP account (@patdavid probably ? :wink: ):

I’m indeed pretty sure your work on these GEGL nodes for G’MIC could raise a lot of interest in the community (having finally a wide variety of filters in GEGL would be really cool :wink: ).
I can only suggest that you keep going! :slight_smile:

The post from GIMP made me think a bit about the fact that the G’MIC-Qt plug-in could become useless (at least for GIMP users), and at this point, there are some limitations of GEGL nodes I’m thinking of, and I’d like to discuss with you (it may be that these limitations are technically impossible to solve due to the architecture of GEGL, but I’m not sure).
So, do you think these points could find a solution somehow in the future ?

I must admit I don’t know the details of GEGL very well. TBH, I always thought that GEGL was, from the outset, a library with a somewhat limited scope (for someone like me who often works professionnally with multispectral 2D/3D images, and not “just” color images), so I never took much interest in it. That’s why I’m counting on your opinion!

  1. G’MIC filters that takes multiple inputs or output multiple layers have to be simplified to 1→1 filters. What mechanism could be used to handle multiple input/output layers in GEGL nodes ?

  2. GEGL on-canvas preview could be possibly annoying for complex G’MIC filters that take a lot of time to render (e.g. denoising). For those, a smaller preview widget like in our plug-in seems to be more suitable (renders faster). What’s your opinion about this?

  3. Not sure how GEGL on-canvas preview works for filters that modify the layer resolution (e.g. upscaling). How does it handle this ? Does the “Before/After” preview work as expected?

  4. It seems it won’t be as easy to update GEGL nodes when G’MIC filters are updated, as in the plug-in (one button click :yum: ). GEGL nodes are generated in a “static” way. Do you think this could be changed in the future (so having a dynamic interface that is reconstructed each time the GEGL node is launched). I’m not sure about that because I fear the interface of a GEGL node (filter parameters) must be all known before it starts.

Let me know what you think about all this.
And thanks again for your hard work!

Hey now that was supposed to be our secret. Also I think it was @Jehan on the gimp account :slight_smile:

1 Like

Thank you for your kind words :blush:

In regards of animation support - not sure yet, will have to eventually check. But I some feeling GStreamer would be a better fit for that [well, I have some plans for that hue hue].

Will see what future holds :slight_smile:

1 Like

ad 1: Im afraid there is no simple way to do it now in GEGL, as it always produces just a single output :confused: Have to be investigated…

ad 2: yeah, I’m still considering how to do it best, for now im just using geg:save-pixbuf operation which makes it simple to integrate with GTK4

ad 3: good question :wink: I had some hard time with dimension changes, need to have a closer look while I will be validating operation by operation,

ad 4: yes, this wont be as straightforward as it is with gmic-qt plugin, my solution requires static code generation as this is how GEGL introspects the possible properties of a given operation, dynamic properties adding is probably not supported yet… but I think I can ask @Pipping some day [author of GEGL itself] :wink:

Thanks! :slight_smile:

1 Like

Just FYI, I’ve just released new version 3.6.5 of G’MIC today.
(hopefully, this version will be used to update the G’MIC-Qt plug-in for Krita).

1 Like