I've been 3 days searching for documentation about python-fu for GIMP 2.8, and the one I find is great, but deprecated.
So I'm now stuck at this place: I've created 3 color channels, and want to add each one of them as a mask to each of 3 layers.
What I've done till now: (manually load the image, and create 3 color channels for lights, middle tones and shadows);
Get it's ID, with:
ima = gimp.image_list()[0]
Get the layer ID and duplicate the layer 3 times:
layn = pdb.gimp_layer_new_from_visible(ima, ima, 'dup')
pdb.gimp_image_insert_layer(ima, layn, None, -1)
Now I have an image with three layers and want to add a layer mask to each of the 3 layers but from the 3 different color channels... but I don't know how.