< Previous | Contents | Next >

Channel Booleans

Channel operations can also do more with 2 images, Foreground, Background and apply pixel for pixel operations Copy, Add, Multiply, Subtract, Divide, Threshold, And, Or, Xor, Negative, Difference, Signed Add.


-- Channel Boolean Math operations, pixel to pixel operations apply a value to image(img) to output (out)

-- Copy, Add, Multiply, Subtract, Divide, Threshold, And, Or, Xor, Negative, Difference, Signed Add


-- Multiply each pixel with a pixel from another image

out = img:ChannelOpOf("Multiply", fg, {R = "fg.R", G = "fg.G", B = "fg.B", A = "fg.A"})

-- Add each pixel with a pixel from another image

out = img:ChannelOpOf("Add", fg, {R = "fg.G", G = "fg.R", B = "fg.B", A = "fg.A"})

-- Threshold low-high

out = img:ChannelOpOf("Threshold", fg,{R="bg.R", G="bg.G", B="bg.B", A="bg.A"}, 0.1, 0.8)

-- Copy fg channels to output

out = img:ChannelOpOf("Copy", fg, {R = "fg.R", G = "fg.G", B = "fg.B", A = "fg.A"})

--Copy one channel to another, fg Red and bg Green and Blue

out = img:ChannelOpOf("Copy", fg, {R = "fg.R", G = "bg.G", B = "bg.B", A = "fg.A"})