Post all Gimp scripts and script writing questions here
Post a reply

GEGL command line and layer modes?

Tue Jul 11, 2023 6:24 am

I am just getting started with gegl. I was pleased to read that there is a command line gegl tool, called, oddly enough, gegl :-)

I'm having some success with gegl, but there are some concepts I'm having trouble understanding.

First, am I going to be able to set layer modes (such as blend mode)? If found another post that uses 'gimp:layer-mode' but this doesn't seem to be supported by the gegl command-line tool.

I did notice a layer operation in the gegl namespace, which has properties for 'composite-op', 'opacity', 'x', 'y', 'scale', and 'src'. But this doesn't include the layer blend mode.

Examples..

% gegl LakeviewWithSunrise.jpg -o z.jpg -- gimp:layer layer-mode=multiply
Error: No such op 'gimp:layer'

% gegl LakeviewWithSunrise.jpg -o z.jpg -- gegl:layer layer-mode=multiply
Error: gegl:layer has no layer-mode property, properties: 'composite-op', 'opacity', 'x', 'y', 'scale', 'src',

Re: GEGL command line and layer modes?

Tue Jul 11, 2023 6:30 pm

The command line version of gegl cannot access Gimp operations directly. It's a 'stand-alone' program.

The gegl operations list is here.

On linux these are the commands to use first.
sudo apt install gegl
gegl --list-all
gegl --info gegl:crop (this gives the options for the crop operation)

My gegl hue chroma script is at comment #36 here.
It's a simple script that rotates the hue chroma values over 35 frames.

Re: GEGL command line and layer modes?

Fri Jul 14, 2023 11:12 am

I recommend you use Gimp's GEGL Graph for this and not GEGL Command line as it has more options; such as Gimp layer modes.

Gimp only blend modes "gimp layer-mode layer-mode=" are not found in stand alone GEGL but they are in Gimp's GEGL Graph and do work in Gimp plugins and I use them because they are better then the default GEGL blend modes.

GEGL Layer which you cited should be ignored in favor of composers.

A composer is a BLENDMODEHERE aux=[] with optional image bookmarks called id and ref. ID is the bookmark and REF calls the bookmark. This is how images are fused with blend modes in GEGL

Here are list of GEGL Only blend modes if you insist on using the cli. Opacity dictates the opacity of the blend mode.

NORMAL BLEND MODE
id=namehere over aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]

MULTIPLY BLEND MODE
id=namehere multiply aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]

SCREEN BLEND MODE
id=namehere screen aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]


OVERLAY BLEND MODE
id=namehere overlay aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]

COLOR DODGE BLEND MODE (like dodge)
id=namehere color-dodge aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]

SOFT LIGHT BLEND MODE
id=namehere soft-light aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]

ADD BLEND MODE (addition clone)
id=namehere add aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]


HARDLIGHT BLEND MODE
id=namehere hard-light aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]

PLUS BLEND MODE (like Gimp's addition but not exactly the same)
id=namehere plus aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]

REPLACE BLEND MODE
id=namehere src aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]

ALPHA LOCK LIKE BLEND MODE SET TO NORMAL
id=namehere src-over aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]


ALPHA LOCK LIKE BLEND MODE SET TO REPLACE
id=namehere src-atop aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]


ERASE BLEND MODE
id=namehere xor aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]


BEHIND BLEND MODE
id=namehere dst-over aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]


MAKE INVISIBLE BLEND MODE (hides content but does not remove it from memory)
id=namehere dst aux=[ ref=namehere content_inside_blend_mode opacity value=1 ]



I hope this GEGL blend mode list helps.

GEGL Layer is useful for Image file uploads but not blending.
Post a reply