I’m trying to wrap my head around what the blend command is doing… or what it’s not doing :P.
I’ve used it before to ‘mix’ two images together, using the opacity parameter to specify how much of each image to use.
blend[0,1] alpha, 0% # Use only the first image
blend[0,1] alpha,33% # Use 33% image 0, 66% image 1
blend[0,1] alpha,50% # mix images together 50/50
blend[0,1] alpha,100% # use only image two
Am I even correct in thinking that’s what’s happening? Results seem to be OK but I didn’t check really if it matches up with my expectation.
Now, here is where I don’t understand how to do something.
I have an image, it is in 0.0 - 1.0 scale (linear gamma if it matters).
I want to blend a certain color, but with an (alpha) mask.
# 0 is my image (3 channels, RGB), 1 is my image filled with a certain color (3 channels, RGB), 2 is my single-channel mask (gray)
append[1,2] c to_rgba. # append mask-channel to image 1, so it now has 4 channels (RGBA)
# 0 is my image (3 channels, RGB), 1 is my color-image with 4th alpha channel
blend[0,1] alpha,100%
# I now expect to have a single image: my source image with the color drawn on top, but using
# the opacity from the mask channel I started with
But I keep ending up with no blend happening at all.
I then thought 'maybe because my source image is RGB and not RGBA. So I made sure it had an alpha channel filled with 1.0 (as in, completely opaque).
Now when I use ‘display’ I see something is blending. It seems to add all channels together, because I end up with an alpha channel in the range 0.0 - 2.0, and every pixel in my source image seems to be affected (the same amount) by the color from the color-image. But this is not what I was expecting :).
(Something about expectation vs reality on my side here :)).
So, how to do something that seems very simple in most photo editors:
I have a source image (bottom layer, ‘background layer’). I create a new layer on top filled with a certain color, and apply a mask / opacity (non-binary to be clear) to that new layer on top.
And then, how to do that with non-normal blend modes (like ‘multiple’, ‘soft light’ or what I was really hoping for: ‘reflect’… hoping it’s the same as Reflect in Affinity Photo’s blending modes).