GIMP Chat
http://gimpchat.com/

Learn GEGL graph
http://gimpchat.com/viewtopic.php?f=10&t=19463
Page 1 of 4

Author:  cli345 [ Wed Jun 23, 2021 10:29 am ]
Post subject:  Learn GEGL graph

Hello, :)

Here is a tutorial to learn the "GEGL graph" filter.
EDIT: For the motivations, you can read this thread first.
EDIT (thanks to rich2005): Warning: this filter doesn't make a single effect, but it enables you to program almost all effects and combine them.

1) First steps:

  • Open an image
  • Go to "Filters->Generic->GEGL graph
    Attachment:
    menu.jpg
    menu.jpg [ 42.83 KiB | Viewed 18315 times ]
  • Click the "pipeline" box
    Attachment:
    pipeline.jpg
    pipeline.jpg [ 53.31 KiB | Viewed 18315 times ]
  • Hit "ctrl-a" and the "delete" key
    Attachment:
    emptyPipeline.jpg
    emptyPipeline.jpg [ 31.1 KiB | Viewed 18315 times ]
  • Write anything (for example, "sdfg")
  • ...to be continued in the next post...

Author:  cli345 [ Wed Jun 23, 2021 10:39 am ]
Post subject:  Re: Learn GEGL graph

  • Look at below the "pipeline" box
    Attachment:
    info.jpg
    info.jpg [ 39.25 KiB | Viewed 18317 times ]
    This part will be the most useful one (It's the info zone)
    but, for now, it's not very useful : it just indicate that the "sdfg" operation doesn't exist
    .
  • Delete "sdfg" and write "e"
    Attachment:
    info2.jpg
    info2.jpg [ 55.76 KiB | Viewed 18317 times ]
    Now, it's more useful, it offers suggestions
    .
  • We choose "gegl:edge". Note: you don't need to write "gegl:"
    So, continue to write to obtain "edge" and look at the info zone for each character you type
    Attachment:
    info3.jpg
    info3.jpg [ 100.13 KiB | Viewed 18317 times ]
    The info zone has disappeared and the "edge" effect is done
    .
  • Congratulations, you have written your first GEGL graph.

Note: Some operations don't belong to GEGL. For these ones, you have to prefix the operation with "gimp:" (for example, "gimp:desaturate").

Have fun!

To be continued...

Author:  cli345 [ Thu Jun 24, 2021 9:56 am ]
Post subject:  Re: Learn GEGL graph

2) How to add parameters:

You wish to add parameters but you don't know which exist :? : no problem ;).
  • After "edge" write a blank space and write "aa=" (without any spaces between "aa" and "=").
    Attachment:
    param1.jpg
    param1.jpg [ 42.31 KiB | Viewed 18234 times ]
    The info zone indicates all possible parameters (It calls them "properties")
    .
  • We choose "algorithm". So replace "aa" by "algorithm"
    Attachment:
    param2.jpg
    param2.jpg [ 43.18 KiB | Viewed 18234 times ]
    The info zone indicates all possible value for the "algorithm" parameter
    .
  • We choose "differential". So, just after "=", write "differential" (without any spaces between "=" and "differential").
    Attachment:
    param3.jpg
    param3.jpg [ 34.14 KiB | Viewed 18234 times ]
    The info zone has disappeared and the "edge algorithm=differential" effect is done
.
CAUTION: "id=blahblah" and "ref=blahblah" look like parameters and are written like parameters but they are NOT, they are special operations
(We will see later their use).
(If you are very curious and cannot wait, "id=blahblah" is "save" and "ref=blahblah" is "retrieve")

Have fun!

To be continued...

Author:  PixLab [ Thu Jun 24, 2021 8:35 pm ]
Post subject:  Re: Learn GEGL graph

I like the way you're teaching, by showing that the cat can walk on our keyboard and the result will be that we won't break anything but get help, is very nice :bigthup

Author:  Wallace [ Fri Jun 25, 2021 1:04 am ]
Post subject:  Re: Learn GEGL graph

Thanks cli345 for taking the time to put this together. :yr
It's been added to our tutorial index.

Author:  cli345 [ Fri Jun 25, 2021 5:28 am ]
Post subject:  Re: Learn GEGL graph

Thanks for your valuable feedback! :tyspin

3) How to chain multiple effects:

You simply list all the effects each in one line like this:
Attachment:
chain.jpg
chain.jpg [ 36.41 KiB | Viewed 18179 times ]
Note: You don't have to put them into multiple lines. You may put them into a single line but separated by spaces (It's just less clear ;)).
Note: We will see later that it's possible to get all intermediate stages back.

Have fun!

To be continued...

Author:  nelo [ Sat Jun 26, 2021 1:42 am ]
Post subject:  Re: Learn GEGL graph

Thanks for doing this tutorial. I find it very helpful.

Author:  cli345 [ Sat Jun 26, 2021 9:49 am ]
Post subject:  Re: Learn GEGL graph

Thanks, nelo, for your valuable feedback! :tyspin

4) How to save and retrieve any intermediate stage:

To save an intermediate stage, simply add the special operation "id=chosenName" where the intermediate stage occurs.
For example:
Attachment:
intermediate1.jpg
intermediate1.jpg [ 33.51 KiB | Viewed 18096 times ]
To retrieve an intermediate stage, simply add the special operation "ref=nameOfStageToRetrieve" where you want it to come back.
For example:
Attachment:
intermediate2.jpg
intermediate2.jpg [ 34.22 KiB | Viewed 18096 times ]
This is a crazy example (since I discard "invert-gamma" result :shock:), but we will see useful examples later.

Have fun!

To be continued...

Author:  mackenzieh [ Sun Jun 27, 2021 12:07 pm ]
Post subject:  Re: Learn GEGL graph

I'm curious as to what this plugin does.

Author:  PixLab [ Mon Jun 28, 2021 4:49 am ]
Post subject:  Re: Learn GEGL graph

Excellent!
Thanks cli345 (out of curiosity, does cli in your nickname stand for "command line interface"?)

Author:  Nidhogg [ Mon Jun 28, 2021 5:49 am ]
Post subject:  Re: Learn GEGL graph

PixLab wrote:
Excellent!
Thanks cli345 (out of curiosity, does cli in your nickname stand for "command line interface"?)

Maybe, but I'm guessing it's derived from Claude and the French city of Lyon.
This looks interesting :bigthup

Author:  cli345 [ Mon Jun 28, 2021 10:06 am ]
Post subject:  Re: Learn GEGL graph

Thank you, mackenzieh, for your question.
Rich2005 has answered here (Thanks, rich2005).

This diagram is aimed to explain my last (crazy) example:
Attachment:
pipelineExplain1b.jpg
pipelineExplain1b.jpg [ 18.08 KiB | Viewed 10804 times ]

(EDIT: I've changed the diagram)

Author:  mackenzieh [ Mon Jun 28, 2021 6:40 pm ]
Post subject:  Re: Learn GEGL graph

cli345 wrote:
Thank you, mackenzieh, for your question.
Rich2005 has answered here (Thanks, rich2005).

This diagram is aimed to explain my last (crazy) example:
Attachment:
pipelineExplain1.jpg


I think I get it now. :)

Author:  cli345 [ Tue Jun 29, 2021 10:13 am ]
Post subject:  Re: Learn GEGL graph

5) How to combine multiple effects:

Some operations (for example, "multiply", "subtract") enable you to combine two results.
These operations accept a special parameter : "aux=[ ... ]" (No space around "=", a mandatory space after "[" and before "]").

For example, one of these operations is "subtract" (this operation does the same job as "subtract" layer mode).
In "GEGL graph", write:
id=myStart

gaussian-blur
id=myBlur

ref=myStart
subtract aux=[ ref=myBlur ]

Notes:
  • (When you've typed "aux=", the info zone says "aux" parameter doesn't exist (It's not true). But, when you've typed "[", the error disappears.)
  • This GEGL graph does the same effect as this process:
    • duplicate the layer
    • apply a gaussian blur onto the upper layer
    • set the mode of upper layer to "subtract"
    • do "merge down" on the upper layer
  • ("aux=[ blahblah ]" seems always accepted but, for most operations, it does not change anything.)
  • This GEGL graph can be compacted to "id=myStart subtract aux=[ ref=myStart gaussian-blur ]"

Have fun!

To be continued...

Author:  Nidhogg [ Tue Jun 29, 2021 3:20 pm ]
Post subject:  Re: Learn GEGL graph

I was just scratching my blockhead if it's possible to change layer modes somehow, having workflows that include stress, fattal and mantiuk filters with changed layer modes. This is fantastic information, now I can convert some of them into GEGL Graph one-clickers.
Thank you Claude. :bigthup

Author:  ico4498 [ Wed Jun 30, 2021 2:23 am ]
Post subject:  Re: Learn GEGL graph

great stuff, thanks!

Author:  cli345 [ Thu Jul 01, 2021 11:41 am ]
Post subject:  Re: Learn GEGL graph

Thanks, for your feedback!

This diagram is aimed to explain my last example:
Attachment:
pipelineExplain2.jpg
pipelineExplain2.jpg [ 26.77 KiB | Viewed 10727 times ]

Author:  cli345 [ Fri Jul 02, 2021 8:40 am ]
Post subject:  Re: Learn GEGL graph

The last diagram can be summarized by:
Attachment:
pipelineExplain2b.jpg
pipelineExplain2b.jpg [ 13.06 KiB | Viewed 10688 times ]

Author:  cli345 [ Wed Jul 07, 2021 9:39 am ]
Post subject:  Re: Learn GEGL graph

6) Practice

Code this "GEGL graph":
Attachment:
practice1.jpg
practice1.jpg [ 38.27 KiB | Viewed 10608 times ]

Here are loose fragments for easy copy-pastes:
noise-reduction
bilateral-filter edge-preservation=100 blur-radius=12
difference-of-gaussians radius1=0.66 radius2=0.22
levels in-low=0.001 in-high=0.01
gimp:desaturate mode=value
invert
antialias
hue-chroma chroma=20 lightness=10
multiply


Warning: At each letter typed, the whole effect is recomputed. So, it's better to write in a text editor and copy-paste onto the "GEGL graph" window.

Have fun!

To be continued...

Author:  Nidhogg [ Wed Jul 07, 2021 1:07 pm ]
Post subject:  Re: Learn GEGL graph

cli345 wrote:
Warning: At each letter typed, the whole effect is recomputed. So, it's better to write in a text editor and copy-paste onto the "GEGL graph" window.
Have fun!
To be continued...

Good hint, I disable preview when testing longer chain of effects and use a small image.
Few times when editing a longer chain somewhere in between, it got stuck and I had to click the GEGL Graph exit button which resulted in crash.

Practice result

Attachment:
GEGL-Practice.png
GEGL-Practice.png [ 445.82 KiB | Viewed 10594 times ]

Page 1 of 4 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/