It is currently Thu Mar 28, 2024 5:15 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 66 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Learn GEGL graph
PostPosted: Wed Jun 23, 2021 10:29 am  (#1) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
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 15571 times ]
  • Click the "pipeline" box
    Attachment:
    pipeline.jpg
    pipeline.jpg [ 53.31 KiB | Viewed 15571 times ]
  • Hit "ctrl-a" and the "delete" key
    Attachment:
    emptyPipeline.jpg
    emptyPipeline.jpg [ 31.1 KiB | Viewed 15571 times ]
  • Write anything (for example, "sdfg")
  • ...to be continued in the next post...

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Last edited by cli345 on Tue Jun 29, 2021 2:10 pm, edited 3 times in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Learn GEGL graph
PostPosted: Wed Jun 23, 2021 10:39 am  (#2) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
  • Look at below the "pipeline" box
    Attachment:
    info.jpg
    info.jpg [ 39.25 KiB | Viewed 15573 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 15573 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 15573 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...

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Thu Jun 24, 2021 9:56 am  (#3) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
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 15490 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 15490 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 15490 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...

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Last edited by cli345 on Tue Jun 29, 2021 10:06 am, edited 1 time in total.

Top
 Post subject: Re: Learn GEGL graph
PostPosted: Thu Jun 24, 2021 8:35 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: May 24, 2021
Posts: 748
Location: SEA - South East Asia
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

_________________
Patrice


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Fri Jun 25, 2021 1:04 am  (#5) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 12978
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
Thanks cli345 for taking the time to put this together. :yr
It's been added to our tutorial index.

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Fri Jun 25, 2021 5:28 am  (#6) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
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 15435 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...

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Last edited by cli345 on Tue Jun 29, 2021 10:07 am, edited 1 time in total.

Top
 Post subject: Re: Learn GEGL graph
PostPosted: Sat Jun 26, 2021 1:42 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Sep 27, 2016
Posts: 345
Location: Germany, BW
Thanks for doing this tutorial. I find it very helpful.

_________________
Regards
nelo

(Gimp 2.10 on Linux Mint MATE 20.1)


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Sat Jun 26, 2021 9:49 am  (#8) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
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 15352 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 15352 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...

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Last edited by cli345 on Tue Jun 29, 2021 10:08 am, edited 1 time in total.

Top
 Post subject: Re: Learn GEGL graph
PostPosted: Sun Jun 27, 2021 12:07 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jul 06, 2013
Posts: 2605
Location: California
I'm curious as to what this plugin does.


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Mon Jun 28, 2021 4:49 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: May 24, 2021
Posts: 748
Location: SEA - South East Asia
Excellent!
Thanks cli345 (out of curiosity, does cli in your nickname stand for "command line interface"?)

_________________
Patrice


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Mon Jun 28, 2021 5:49 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
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


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Mon Jun 28, 2021 10:06 am  (#12) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
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 7939 times ]

(EDIT: I've changed the diagram)

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Last edited by cli345 on Tue Jun 29, 2021 12:03 pm, edited 1 time in total.

Top
 Post subject: Re: Learn GEGL graph
PostPosted: Mon Jun 28, 2021 6:40 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Jul 06, 2013
Posts: 2605
Location: California
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. :)


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Tue Jun 29, 2021 10:13 am  (#14) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
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...

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Tue Jun 29, 2021 3:20 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
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


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Wed Jun 30, 2021 2:23 am  (#16) 
Offline
GimpChat Member

Joined: Jun 04, 2011
Posts: 80
great stuff, thanks!


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Thu Jul 01, 2021 11:41 am  (#17) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
Thanks, for your feedback!

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

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Fri Jul 02, 2021 8:40 am  (#18) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
The last diagram can be summarized by:
Attachment:
pipelineExplain2b.jpg
pipelineExplain2b.jpg [ 13.06 KiB | Viewed 7823 times ]

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Wed Jul 07, 2021 9:39 am  (#19) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
6) Practice

Code this "GEGL graph":
Attachment:
practice1.jpg
practice1.jpg [ 38.27 KiB | Viewed 7743 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...

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Top
 Post subject: Re: Learn GEGL graph
PostPosted: Wed Jul 07, 2021 1:07 pm  (#20) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
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 7729 times ]


Top
Post new topic Reply to topic  [ 66 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts What does GEGL graph do ?

65

No new posts Get use to using GEGL Graph syntax.I can't make a filter of everything

13

No new posts Attachment(s) Long time GEGL Graph Glitch solved. Need Help testing bevel update

2

No new posts Attachment(s) How to select color from light spectrum graph ?

2

No new posts Attachment(s) GEGL "Glass over Text' is STAND ALONE BUT NOW PART OF GEGL EFFECTS

5



* Login  



Powered by phpBB3 © phpBB Group