You are here

Gegl for py gimp plugins


Requires hack gegl.

With pygegl, let's you use gegl in python gimp plugin.


you did not give much detail !

I am no python coder but i have a practical case:
i will like do do this operation:

1) create a duplicate of active layer
2) apply Gegl C2G operation to the dup
3) OPTIONALLY,2 px gaussian blur on the "original" active layer
3) merge down the duplicate in Value ,and/or Overlay,and/or Grain Merge

INPUT repeat for all visible layers
OUTPUT each on a new new image to be saved in a user specified directory

as now a similar script will be no possible because was no possible call a gegl operation, what you proposed could solve ?

I didn't give much detail because I was using a tablet without a real keyboard, and some detail is in the README file in the source code, which you can browse online by following the link.

From what I understand of your problem:

1) yes with this experimental code you could access the C2G operation now (or any other gegl op.) You could do that before, using PyGEGL, but it was not integrated with GIMP. This experiment provides gegl operations that source and sink to a GIMP layer.

2) but isn't C2G also in GIMP? ( I don't know what C2G is or whether it is in gimp.) If so, this experiment would not really help you.

3) your problem is partly a "batch" problem: you want to do the same operation repeatedly on a sequence of layers. This experiment would not help you do that.

4) what this experiment MIGHT do is let you quickly preview the results. Suppose you set up a gegl graph of your operations. It is hard to describe a graph in text, but something like this in LISP like syntax (merge (C2G) (blur)) , which is a tree (an upside down tree, think of it as a funnel.) Then you could create a GUI dialog that had the parameters of all the operations. Every time you changed one parameter (say the kind of merge), you could process the gegl pipeline and quickly (?) see the results. You change the parameters and view the preview (which could actually be a separate display or a layer in the main gimp window) while the plugin is still running. It also requires the plugin to have its own GUI dialog which stays open even after you push an "Apply" button (or just hit Tab after changing a parameter), which is not easy to program (you would need to know PyGTK or similar.)

What I have described is what will eventually be in GIMP itself (say in 3.0.) I think they call it adjustment layers. Or, a GUI more like Blender.

So if it is coming in GIMP, why would you want it in a plugin? Will this experiment become obsolete? Possibly you would still want to create a plugin that hides the details of the operation (setting up the graph, all those adjustment layers.)

i saw your reply just now

As default C2g exist in gimp only as gegl operation ,as far i know (may be some custom script or plugin to emulate the effect, i believe i tried once a "c2g" script but i was not very happy with it )

the reason to do is that c2g is really slow (slow but apparently never crashes, at least never crashed for me even with dramatic setting on 4800 x3600 images ) so if i can't find the way to automate i could start a batch before going to work , and find everything ready when i am back

the action would be quite simple, thinking better i just need to

1 applly c2g on a dup layer,
2) save in same directory with same name (original wuild be png or jpg so no risk to overwrite them
with a xcf )

the other 2 steps (g. blur on the original layer and merge down in value or overlay mode ) i may better do manually because are very quick and may require manual finetuning


I believe the effect can be interesting also for a plugin (or a new gegl node) in gegl already all the 3 needed operations (the others are gaussian blur and apply layer mode ) are implemented..would be quite slow but i doubt perceptibly slower of c2g itself

but again my main interest is just be able to apply c2g in batch

Subscribe to Comments for "Gegl for py gimp plugins"