Sander, your description of post-multiplication (pre-multiplication in the Other Compositors) is pretty good, but I think you're going to confuse yourself and others by using integer 0-255 values instead of normalized 0-1 values.
For instance, if you multiply 128 * 128, your math education suggests you should get 16,384, right? But instead you get 64. What gives? In fact, the imaging software is always doing its math in normalized 0-1 values, so what you're actually doing is 0.5 * 0.5 = 0.25. (0.25 * 255 = 64.75) That's why the image gets darker when you multiply instead of brighter.
Train yourself to think in these normalized terms, and you'll have a much easier time understanding and communicating the image processing math.
--
Now, Umberto, the reason your image looks translucent in picture three is exactly as Sander said: The RGB pixels still have their original values, but since the Alpha is 0, they get added to whatever's in the background. In this case, the checkerboard pattern of the canvas. If you were to turn off Show Checker Underlay in the viewer, then picture 3 would look exactly like picture 1 because it would be adding the 0 of the black canvas to those pixels instead of greys and whites.
Sometimes that might be exactly what you want to happen. If you need to composite a light source into an image, it's common to do it by setting the alpha to 0 without post-multiplying. When you then perform an additive Merge, the light is simply added instead to the background instead of having its alpha channel carved out of the background first.
Another way to get the result you were after is to set the ChannelBooleans node to Clear and put your matte in the Mask input. Or if you wanted to do it really explicitly, you could set the ChannelBooleans up to Multiply or And (they're functionally the same operation) the image by the matte, which you would have to put into the Foreground input.
- Code: Select all
{
Tools = ordered() {
Polygon1 = PolylineMask {
DrawMode = "InsertAndModify",
DrawMode2 = "InsertAndModify",
Inputs = {
MaskWidth = Input { Value = 1920, },
MaskHeight = Input { Value = 1080, },
PixelAspect = Input { Value = { 1, 1 }, },
ClippingMode = Input { Value = FuID { "None" }, },
Polyline = Input {
SourceOp = "Polygon1Polyline",
Source = "Value",
},
Polyline2 = Input {
Value = Polyline {
},
Disabled = true,
},
},
ViewInfo = OperatorInfo { Pos = { 746, 123 } },
},
Polygon1Polyline = BezierSpline {
SplineColor = { Red = 173, Green = 255, Blue = 47 },
NameSet = true,
KeyFrames = {
[0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
Closed = true,
Points = {
{ X = -0.0364583320915699, Y = 0.0379629619419575, LX = -0.030170509912323, LY = -0.0177670786938803, RX = 0.0277777773638566, RY = 0.0163580250316932 },
{ X = 0.046875, Y = 0.0870370343327522, LX = -0.0130208333333334, LY = 0.00277777507349298, RX = 0.0289917223614211, RY = -0.00618489474917253 },
{ X = 0.126041665673256, Y = 0.0203703697770834, LX = -0.00208333432674412, LY = 0.0157407401474538, RX = 0.00538208463188556, RY = -0.0406646185178131 },
{ X = 0.103124998509884, Y = -0.0981481447815895, LX = 0.0296874985098838, LY = 0.0194444478110031, RX = -0.0397789549768681, RY = -0.0260540582011798 },
{ X = -0.0234375, Y = -0.120370373129845, LX = -0.00989583333333334, LY = -0.0259259286854002, RX = 0.0202203555300076, RY = 0.0529749721732462 },
{ X = 0.0770833343267441, Y = -0.0500000007450581, LX = -0.00312499900658928, LY = -0.0194444451895025, RX = 0.00505315494664761, RY = 0.0314418642012283 },
{ X = 0.058854166418314, Y = 0.0425925925374031, LX = 0.010416666418314, LY = -0.00370370375889318, RX = -0.0311654909142683, RY = 0.0110810638654981 }
}
} }
}
},
ChannelBooleans1_1 = ChannelBoolean {
CustomData = {
Settings = {
[1] = {
Tools = ordered() {
ChannelBooleans1_1 = ChannelBoolean {
Inputs = {
Background = Input {
SourceOp = "RsAmbientOcclusion_090_MonumentValley_Car_BTY_",
Source = "Output"
}
},
Name = "ChannelBooleans1_1",
CtrlWZoom = false,
ViewInfo = OperatorInfo { Pos = { 440, -313.5 } },
CustomData = {
}
}
}
},
[2] = {
Tools = ordered() {
ChannelBooleans1 = ChannelBoolean {
Inputs = {
Operation = Input { Value = 1 },
ToAlpha = Input { Value = 4 }
},
CtrlWZoom = false,
ViewInfo = OperatorInfo { Pos = { 1265, 181.5 } },
CustomData = {
}
}
}
},
[3] = {
Tools = ordered() {
ChannelBooleans1 = ChannelBoolean {
Inputs = {
Operation = Input { Value = 2 },
ToAlpha = Input { Value = 4 }
},
CtrlWZoom = false,
ViewInfo = OperatorInfo { Pos = { 1265, 181.5 } },
CustomData = {
}
}
}
},
[4] = {
Tools = ordered() {
ChannelBooleans1 = ChannelBoolean {
Inputs = {
Operation = Input { Value = 6 },
ToAlpha = Input { Value = 4 }
},
CtrlWZoom = false,
ViewInfo = OperatorInfo { Pos = { 1265, 181.5 } },
CustomData = {
}
}
}
},
[5] = {
Tools = ordered() {
ChannelBooleans1_1 = ChannelBoolean {
Inputs = {
ToRed = Input { Value = 3 },
ToGreen = Input { Value = 3 },
Operation = Input { Value = 7 },
Background = Input {
SourceOp = "RsAmbientOcclusion_090_MonumentValley_Car_BTY_",
Source = "Output"
},
ToBlue = Input { Value = 3 },
ToAlpha = Input { Value = 4 }
},
CtrlWZoom = false,
ViewInfo = OperatorInfo { Pos = { 440, -313.5 } },
CustomData = {
}
}
}
},
}
},
Inputs = {
Operation = Input { Value = 6, },
ToRed = Input { Value = 3, },
ToGreen = Input { Value = 3, },
ToBlue = Input { Value = 3, },
Background = Input {
SourceOp = "Background1",
Source = "Output",
},
Foreground = Input {
SourceOp = "Polygon1",
Source = "Mask",
},
},
ViewInfo = OperatorInfo { Pos = { 788, 240 } },
},
Background1 = Background {
CtrlWZoom = false,
Inputs = {
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
TopLeftRed = Input { Value = 0.225, },
TopLeftGreen = Input { Value = 0.538, },
TopLeftBlue = Input { Value = 0.731, },
},
ViewInfo = OperatorInfo { Pos = { 620, 239 } },
}
}
}