Hi there,
I made my first filter in G’mic and even though I fear something like this is already available inside the plethora G’mic filters, I thought I’d share it. It basically creates three layers based on the hues R, G and B. I use these either in overlay or soft light mode to boost or dampen certain hues, or I use them as masks to select certain hues and work them.
Some examples:
Basic image
Inverted blue layer in soft light mode, darken blues, lighten yellows:
Inverted blue layer plus blue mask, to darken the blues without brightening the yellows:
Copy of base image with a red mask to select reddish hues, then added contrast and saturation:
Technically the filter works like this. Think of a color wheel. To create the red layer, prject the blue and green “vectors” onto the red “axis” and subtract both from the red value. In you created layer all colors from the half circle where the red lays are brighter than neutral grey, all other are darker. Same is done for the other colors.
Maybe it is of interest to somebody.
Here’s the code:
#@gimp Hue Overlay Masks : hue_overlay_masks, hue_overlay_masks_preview(0)
#@gimp : note = note{"\n"}
#@gimp : note = note{“This plugin creates RGB hue masks. They are be exported in overlay mode into Gimp. Try each one to see how it changes your picture. Alternatively you can use them as masks to select regions based on hue.”}
#@gimp : sep = separator()
#@gimp : Stretch constrast = bool(0)
hue_overlay_masks :
100%,100%,1,1,"R#0/2-(G#0+B#0)/4+128"
100%,100%,1,1,"G#0/2-(R#0+B#0)/4+128"
100%,100%,1,1,"B#0/2-(R#0+G#0)/4+128"
-name[-3] "name(Red), mode(overlay)"
-name[-2] "name(Green),mode(overlay)"
-name[-1] "name(Blue),mode(overlay)"
-if {$1==1}
-if '{iM[1]-128 > 128-im[1]}'
-fill[1] '(i-128)/abs(iM-128)*128+128'
-else
-fill[1] '(i-128)/abs(im-128)*128+128'
-endif
-if '{iM[2]-128 > 128-im[2]}'
-fill[2] '(i-128)/abs(iM-128)*128+128'
-else
-fill[2] '(i-128)/abs(im-128)*128+128'
-endif
-if '{iM[3]-128 > 128-im[3]}'
-fill[3] '(i-128)/abs(iM-128)*128+128'
-else
-fill[3] '(i-128)/abs(im-128)*128+128'
-endif
-endif
-move[1] 0
-move[2] 1
-move[3] 2
fx_split_colors_preview : -gui_split_preview "-fx_split_colors $*",$-1