PDA

View Full Version : confused with elementary maths in compositing


mister3d
01-29-2009, 04:31 PM
Hi dear friends.
I'm trying to learn some compositing basics, and there's a multiplication operation. To me this means: rgb multiplied is let's say 2.2.2 x 2 = 4.4.4. But why the image becomes darker? If I multiply the image by alpha, it becomes black where the alpha is black and remains the same where alpha is white. Why is that? Isn't 4 is brighter value than 2?
And will addition, subtraction and division do the same weird stuff?
Addition 2.2.2 + 2.2.2 = 4.4.4 brighter
subtraction 2.2.2 - 1.1.1 = 1.1.1 darker
division 4.4.4 / 2 = 2.2.2 darker Right?

th3ta
01-29-2009, 07:20 PM
The operation multiply multiplies every pixel in image A with the corresponding pixel in image B.

So if you have a color photo (image A) and you multiply it with an alpha image (image B), then wherever there is a pixel value of 1 in your alpha (white) it will return the value that was in image A. Because 1 * any RGB value = any RGB Value.

On the other hand, if you multiply anything by 0, then you get 0 (black). That is why in your new multiplied image you get black where it is black in the alpha.

mister3d
01-29-2009, 07:33 PM
Thank you Theta.waves, I think I got it: it multiplies not 0-255 of an alpha channel value, but a normalised 0-1, so the multiplied value never exceeds 1 (the initial A image values) and only can be darkened by a smaller normalised alpha value.

CGTalk Moderation
01-29-2009, 07:33 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.