Darby Edelen
Forum Replies Created
-
I’m sorry, I think you’re missing the forest for the trees.
The only reason to have transparency is to blend the image over another image.
What I’m telling you is that the blending operation itself is color space and gamma independent. Only the colors involved in the blend are dependent on the color space and gamma. Alpha values should never change between color spaces, the alpha is not a color, it is a weighting for the blend operation. Which, as I’ve already said, does not depend on color space or gamma.
I think you need to provide a concrete example of why you want the alpha to change its values when rendering from linear to gamma encoded. Are you trying to preserve the look of a linear blend? If so then modifying the alpha will never get you there*. If not, then there’s no reason to work in linear to begin with.
*Except in the special case of blending pure colors (100% or 0% intensity in all channels) with white or black.
Darby Edelen
-
Here’s a test image with a 100% Red solid blended with a 100% Green solid, the blend is a linear ramp.
Here’s the resulting blend in a linear working space:
Here’s the resulting blend in a gamma encoded working space:
There is no way to modify the alpha of the Red solid in a gamma encoded space to produce the same result as the blend in linear space.
In this case the way to get the gamma encoded blend to look like the linear blend is to transform the resulting colors from linear values to gamma encoded values. The closest you can get in Photoshop is to apply a gamma of 2.2 or so to the gamma encoded result (I was using sRGB in these examples).
This is a simple example because none of the straight RGB colors involved are affected by gamma. However, if you’re using RGB values that aren’t 1 or 0 in every channel then there’s an extra step: you have to linearize the colors before blending by applying the inverse gamma to each blend layer.
Here’s the red gradient I was using in these examples. I’d encourage you to try adjusting the alpha to compensate for the difference and then the RGB values:
To re-iterate: it is not the alpha that makes these blends look different, it is the interpretation of the RGB values.
Darby Edelen
-
As should’ve been apparent in my previous reply the “density” of the blend depends on a combination of how colors are interpreted and what the alpha values are. There is simply no way to get the same perceptual result as a blend in linear space in gamma space by modifying the alpha because the colors are interpreted differently.
If you still don’t believe it I can put more comprehensive examples together (with pictures!) when I have some free time at my computer.
Darby Edelen
-
[Andrew Somers] “even though the input image data is the same.”
The input image data (the numerical values of the colors in the layer) is generally only the same between linear and gamma spaces inside of After Effects if you’re using a native AE layer (text layer, solid layer, shape layer) as your assets. Otherwise the image data of imported assets is modified to attempt to maintain perceptual uniformity.
Similarly, when AE exports your image using color management from linear to gamma encoded the numerical color values change which is what causes the blends to look different. The alpha should not be color managed as it’s just a weighting for blend operations.
A 10% opaque white layer will appear “more dense” above a solid 100% red layer in linear but a 10% opaque black layer will appear “less dense” in linear.
The White Blend:
(1.0, 1.0, 1.0)(RGB) * 0.1(Alpha weighting) + (1.0, 0.0, 0.0)(RGB) * (1 – 0.1)(Alpha weighting) = (0.1,0.1,0.1) + (0.9,0.0,0.0) = (1,0.1,0.1)So the resulting color is (1, 0.1, 0.1) in both gamma and linear space. However, this color is much whiter in linear space than a gamma encoded space (0.1 is almost middle gray in linear, it’s almost black in gamma encoded). The white blend will look more dense in a linear space because the working color space values are not perceptually weighted.
The Black Blend:
(0.0, 0.0, 0.0) * 0.1 + (1.0, 0.0, 0.0) * (1 – 0.1) = (0.0, 0.0, 0.0) + (0.9, 0.0, 0.0)So the resulting color is (0.9, 0.0, 0.0) in both gamma and linear space. However, this color is darker in gamma space because 0.9 is darker than in linear (you can look at the linear vs. gamma encoded color picker to see this). The black blend will appear more dense in a gamma encoded space because the working color space values are perceptually weighted toward the dark end.
That should be a good indication that it is not the alpha values that affect the difference in blending.
Darby Edelen
-
Realizing that the previous post wasn’t very encouraging I’ll add that if you want the blend to look the same you actually need to adjust the RGB values not the alpha.
Both blend layers would need to be re-interpreted from the gamma encoded space to a linear space, then the blend would occur and then you’d translate the resulting colors from the linear space to gamma encoded. Of course this is what a linear composting workflow does behind the scenes so instead of that whole rigmarole I’d either work the way you’ve decided to (in gamma) or bug the people downstream to work they way they should (in linear).
Darby Edelen
-
[Andrew Somers] “it is typically going to be used in a system where compositing operations are performed in a gamma encoded space.”
Well that seems like the problem right there.
The results of blending in a gamma encoded space won’t be the same as the results in a linear space if you just tried to mess with the alpha values. Remember, alpha is just a numerical weighting of the blend operation, but the difference between linear and gamma encoded space is not in the blend operation, rather it’s in the input to the blend operation (the colors that are being blended) and the output (the interpretation of the resulting color).
No amount of fussing with the alpha could give you the same blend results in a gamma encoded space as a linear space.
Darby Edelen
-
Darby Edelen
April 24, 2015 at 11:56 pm in reply to: Refraction for After Effects CC after Normality?Nuke’s IDistort node is equivalent to After Effects’ Displacement Map effect.
Darby Edelen
-
Darby Edelen
April 22, 2015 at 1:51 am in reply to: Use 3D null position to animate a stroke of a lineYou can apply two instances of particular to the same layer, or two layers each with particular. Link the emitter positions to a null instead of a light.
Darby Edelen
-
Darby Edelen
April 21, 2015 at 6:30 am in reply to: Use 3D null position to animate a stroke of a lineI’ve always done this with particular. You can use a light, or a layer or link a null’s position to the emitter.
Darby Edelen
-
Darby Edelen
April 21, 2015 at 1:02 am in reply to: Need an effect like beam, but with option to grow lines from one end to the other instead of from the middleTry the Time property of the Beam effect.
Darby Edelen

