Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Linear space and alpha channel output

  • Linear space and alpha channel output

    Posted by Andrew Somers on April 29, 2015 at 1:33 pm

    I am wondering if there is a plug-in to handle this:

    When working in a linearized color space but outputting to a gamma encoded space such as Rec709, the ALPHA channel is not output correctly – the alpha that is output Is based on opacity for linear (gamma 1.0) blending – however, when we are outputting a gamma encoded file, such as say a tiff with alpha, it is typically going to be used in a system where compositing operations are performed in a gamma encoded space.

    As such, the alpha should reflect the different opacities needed for correct compositing in the gamma encoded space of the output file, and NOT the opacities used in the linear (gamma 1.0) space.

    Ideally, there should be a switch/checkbox in the color management tab of the output module that addresses this, such as: “Alter alpha opacities to match perceptual intent of output gamma”.

    At the moment, it seems the best/only way to handle this is to work in the same gamma encoded space as the final output.

    Any other thoughts?

    Darby Edelen replied 10 years, 5 months ago 3 Members · 16 Replies
  • 16 Replies
  • Andrew Somers

    April 29, 2015 at 4:44 pm

    That doesn’t solve the problem, as delivery specs are RGBA. If it was only our internal workflow it wouldn’t be a problem, but the image sequence and/or QuickTime must be handed off to another facility, and we have to meet their delivery specs.

    Our normal internal workflow is a linear (gamma 1.0) colorspace, but due to this issues we must use a gamma encoded colorspace when we need to associate an alpha channel.

    The problem remains: linear colorspaces use a different opacity than gamma encoded spaces for the same perceptual intent, and AE does not compensate.

  • Walter Soyka

    April 30, 2015 at 1:03 pm

    [Andrew Somers] “The problem remains: linear colorspaces use a different opacity than gamma encoded spaces for the same perceptual intent, and AE does not compensate.”

    I know this doesn’t help you now, but I think this should be filed as a bug [link].

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Darby Edelen

    April 30, 2015 at 9:07 pm

    [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 30, 2015 at 9:20 pm

    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

    May 1, 2015 at 11:20 am

    At Darby: After Effects’ output module does a good job of converting the image data from linear space to a gamma encoded space. What After Effects fails to do is convert the opacity data from linear to gamma encoded.

    The numerical value of the alpha channel relative to a linear ColorSpace results in a substantially different perceptual blend them the same numerical value in a gamma encoded space.

    For instance 10% opacity in linear space will appear denser than 10% in a gamma encoded space, even though the input image data is the same.

  • Darby Edelen

    May 1, 2015 at 6:05 pm

    [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

  • Andrew Somers

    May 2, 2015 at 2:45 am

    Darby, we are talking about two different things.

    If you take white text, and set opacity to 10%, the perceived transparency in linear is denser than it is in a gamma encoded space. But that is not what I am talking about.

    If you are working in linear space, and use an output module to output to a tiff using a gamma encoded space such as rec709 or sRGB, and your alpha is straight, the image will be perceptually the same when viewed in the gamma encoded space as it was while working in linear space.

    However, the alpha will not work on systems that use the gamma encoded space to blend.

    However if you import that image into a linear space environment, the alpha values will be correct.

    If you convert to a gamma encoded space, the alpha values must be changed to accomplish the same perceptual intent. This means that when after effects outputs from a linear working space to a gamma encoded space, it is not converting the alpha values to create the same perceptual intent. It should be clear that this makes the gamma encoded RGBA output unuseable.

    The workaround is to NOT use linear space when the output needs to have an alpha and be in a gamma encoded space.

    The color values of the text are correct when opacity is 100%. And when alpha is straight, these RGB values do NOT change. But the opacity as interpreted by a compositing system that is blending in gamma encoded space does not match that of the perceptual intent when working in linear space.

    I’ve been playing with modifying the alpha channel values – but ideally there would be an option in the output module to adjust the alpha for the same perceptual intent. It is the alpha. The alpha needs to be modified ALONG WITH the RGB data when outputting from linear to a gamma encoded space.

  • Darby Edelen

    May 2, 2015 at 7:38 pm

    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

  • Darby Edelen

    May 4, 2015 at 9:11 pm

    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:

    8810_redgradient.tif.zip

    To re-iterate: it is not the alpha that makes these blends look different, it is the interpretation of the RGB values.

    Darby Edelen

  • Andrew Somers

    May 5, 2015 at 2:34 am

    Darby, we are still not discussing the same thing.

    I am not talking about blends of colors in linear space.

    I am talking about TRANSPARENCY.

    White titles coming out using the output module’s conversion to a gamma encoded space do not have the same perceptual transparency because the output module’s alpha channel is wrong.

    It is trivial to convert the RGB image data from a linear space to a gamma encoded space. What is needed is to also convert the alpha channel to provide the same relative transparency in the target application.

Page 1 of 2

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy