pdb.gimp_layer_set_composite_mode(group, LAYER_COMPOSITE_UNION)
But I’ll add the option to the script, if you can wait until this evening.
pdb.gimp_layer_set_composite_mode(group, LAYER_COMPOSITE_UNION)
But I’ll add the option to the script, if you can wait until this evening.
OT, sorry, but your skelecyclist images are awesome!
Option added to new version uploaded to SourceForge
Thank you so much!
It’s part of my new “Chromadrift” collection… Available on my “Psyberspace” shops
You can check out all my shops via this link:
I am still working on more designs in this and other genres … so stay tuned via Instagram @Mindful.Designs.Haven
Awesome Sir!
Thank you!
If you are on it… one more request (and aporopo of Barry’s comment about the image)
Can you please create a version that separates the layer into Red and Cyan channels (Union mode)?
I tried to get ChatGPT to do it - but for some reason it doesn’t appear in the menu (I am guessing it fails to compile…?)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# GIMP plugin to decompose a layer into layers for each channel
# (c) Ofnuts 2021
#
# History:
#
# v0.0: 2022-04-17 First published version
# v0.1: 2022-04-17 DRY
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This very file is the complete source code to the program.
#
# If you make and redistribute changes to this code, please mark it
# in reasonable ways as different from the original version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# The GPL v3 licence is available at: https://www.gnu.org/licenses/gpl-3.0.en.html
import sys, os, os.path, traceback
from gimpfu import *
import gimpcolor
debug = 'OFN_DEBUG' in os.environ
def trace(format, *args):
if debug:
print(format % args)
def createGroup(image, layer, topGroup, channelColor, channelName):
channelGroup = gimp.GroupLayer(image, channelName + " component")
image.insert_layer(channelGroup, topGroup, 0)
channelGroup.mode = LAYER_MODE_ADDITION
layerCopy = layer.copy()
layerCopy.name = layer.name + " - " + channelName
image.insert_layer(layerCopy, channelGroup, 0)
channelMask = gimp.Layer(image, channelName + " mask", image.width, image.height, RGBA_IMAGE, 100, LAYER_MODE_MULTIPLY)
image.insert_layer(channelMask, channelGroup, 0)
pdb.gimp_context_set_foreground(channelColor)
channelMask.fill(FILL_FOREGROUND)
def layerDecompose(image, layer):
gimp.context_push()
image.undo_group_start()
try:
layerParent = layer.parent
layerPosition = pdb.gimp_image_get_item_position(image, layer)
surrogateGroup = gimp.GroupLayer(image, layer.name + "- components")
surrogateGroup.mode = layer.mode
surrogateGroup.opacity
pdb.gimp_image_insert_layer(image, surrogateGroup, layerParent, layerPosition)
for mask, name in [((1.0, 0.0, 0.0), "Red"), ((0.0, 1.0, 1.0), "Cyan")]:
createGroup(image, layer, surrogateGroup, gimpcolor.RGB(*mask), name)
image.remove_layer(layer)
except Exception as e:
pdb.gimp_message(e.args[0])
traceback.print_exc()
image.undo_group_end()
gimp.context_pop()
### Registrations
author='Ofnuts'
year='2021'
menu='<Image>/Layer/'
desc='Decompose layer ro red and cyan'
whoiam='\n'+os.path.abspath(sys.argv[0])
register(
'Layer Decompose to 2',
desc,desc+whoiam,author,author,year,desc+'...',
'RGB*',
[
(PF_IMAGE, 'image', 'Input image', None),
(PF_DRAWABLE, 'layer', 'Input layer', None),
],
[],
layerDecompose,
menu=menu
)
main()
Can you point me out to what’s wrong? (I am not a programmer… )
I have some more mountain biking pics (Skeletal and not )
But here’s something I’m currently working on which I really like
(Done in the two-channel red/cyan style I asked from Ofnuts )
Thank you Sir!
Hi,
After manually Merging the G + B layers, setting them to addition, and composite to union - thousands of times …!
Can you PLEASE make a script that does it automatically?
Decompose to (R, G+B), flatten layers, addition, composite union …
PLEASE!
(I couldn’t manage to do it on my own as this is not documented… )
Thanks!
Are you taking about my ofn-layer-decompose
script? If so I don’t see what it is missing?