Straight vs Premultiplied : Understanding Alpha Channels

I am often asked the question “What is the difference between a Straight and a Premultiplied Alpha Channel?”

In this tutorial I discuss the differences between a Straight and a Premultiplied Alpha channel.  How to spot the difference and ensure you interpret your files correctly when setting up your composite.

I also cover the Straight Alpha parameter that is offered when rendering Cinema 4D Multipass renders.

Head on over to Vimeo to watch the tutorial in HD.


Straight vs Premultiplied : Understanding Alpha Channels

Author: Tim

14 Comments

  1. […] This post was mentioned on Twitter by Brad Chmielewski, Joe Myers, Philip Vetter, topsy_top20k, Tim Clapham and others. Tim Clapham said: Straight vs Premultiplied : Understanding Alpha Channels : New post on helloluxx : http://bit.ly/cLnIon http://bit.ly/cFHRxP […]

  2. uberVU - social comments On April 19, 2010 at 2:21 PM

    Social comments and analytics for this post…

    This post was mentioned on Twitter by helloluxx: Straight vs Premultiplied : Understanding Alpha Channels : New post on helloluxx : http://bit.ly/cLnIon http://bit.ly/bOY0Uo

  3. stphn
    stphn On April 19, 2010 at 6:43 PM

    Thanks, it’s very usefull, but I still have a question about alpha on C4D, when I import a PSD layer with transparancy in the color matérial dialoque and the alpha dialogue, its working, but still have a white border around the layer. Is there any way to get a nice and clean output of these?

    Thanks for your help, it always usefull tips and courses and maybe it’s coincidence but always at the right moment.

    Thanks again!

  4. Tim
    Tim On April 19, 2010 at 7:26 PM

    If you have a PSD and the artwork is on a layer with transparency, you have to actually go into the material and tell cinema which layer you wish to use. Load the PSD into your material channel, and then click on the image to open the bitmap properties. There is a button called Layerset, click here and you can open up and choose the layer you wish to use. When you wish to use this in the alpha channel of a material then you should choose Layer Alpha or Generate Alpha.

    The reason you get the white border if you do not do this is because the PSD is brought in as a flattened composite image, therefore your layer is placed onto white. The alpha channel then introduces the white border where the anti-aliasing in the alpha crosses from opaque to semi-transparent. Specify the layer you want to use for the colour and alpha channel and you don’t get this issue.

    This is actually a very handy feature that allows you to specify different layers from the same PSD for different materials or channels. So you can create a lot of artwork and store it all in one PSD file and then use each layer in unique materials.

  5. stphn
    stphn On April 20, 2010 at 6:47 AM

    Thank you very much i try this right now i got so many questions but one thing at a time 🙂 thanks again !!

  6. thomas
    thomas On April 21, 2010 at 4:03 AM

    thx, thats a very good explanation, but, there are still some issues with alpha channels when using multipass rendering.
    if you render some objectbuffers via multipass in cinema4d, they never seem to really match together. while comositing, it allways looks, like there is a small thin line around the object, it look like the alphachannel is approximately 1px to big. is there any chance to get rid of that problem? if you have any idea what might cause that problem, or how to eliminate it, it would be nice if you can put this topic into your next tutorial. btw which are awesome clearly explained **thumbsup**

    THX again!

    • Tim
      Tim On April 21, 2010 at 11:22 AM

      This not due to the alpha working incorrectly but the fact that you are using an object buffer (matte) on the RGB image after the alpha has been interpreted. Therefore the problem occurs in the areas that have anti-aliasing between opaque and semi-transparent image because the same area occurs on the matte and the RGB image. For a clean result the RGB channels still need colour information there and then the matte would produce the soft AA edge.

      You can get around this and use the buffer as a matte on the RGB image, but you need to render the RGBA with a straight alpha, and when you create the track matte use a copy of the RGB image that has the alpha ignored. Then the colour information is still in the semi transparent areas so the object buffer should cut out the transparent areas and leave a clean result in semi transparent areas such as the anti-aliasing along the edges. However due to the nature of an object buffer being used to cut out objects from the RGB render, the chances are that it will have some other part of the scene behind or overlapping it. In which case this won’t work.

      So realistically you have to live with the dark halo around the edge of objects extracted from your main render using object buffers. This is something you have to deal with for the convenience of having the object buffer and not having to render the objects as individual separate passes.

      However all is not lost and you can pretty much resolve this every time by isolating the object using it’s object buffer in a precomp. Then when you use this precomp in your main comp you can use the Remove Color Matting effect to get rid of the thin black line around the edge. In some situations this may not be perfect and you may have to fiddle a little with choking and refining the matte slightly.

      Hopefully that answers your question!

  7. Sataneev
    Sataneev On April 21, 2010 at 11:09 PM

    Thanks for your tip, Tim!
    Especially that part was very useful for me:
    “…and when you create the track matte use a copy of the RGB image that has the alpha ignored…”
    Till now i was messing around with minimax effect.
    Also will be very interesting to know your opinion about LWF (linear workflow) and plugin DeGamma.
    With best regards!

  8. Thomas
    Thomas On September 15, 2010 at 1:46 PM

    Great explanation, man. Very much appreciated, and I’m very grateful! Thanks a lot!

  9. rich
    rich On October 26, 2010 at 12:59 PM

    Hey Tim,
    great tutorial, thanks for this. Am having problems with straight alphas out of cinema4d still. If you render a white cube with default lighting and look at the rgb channels, the edge pixels are much brighter – almost like its not taking the diffuse into account. When compositing it i’m getting a strange white halo.

    I put a post here about the problem i was having with some images, wondering if you might have any ideas?
    http://mograph.net/board/index.php?showtopic=24203

    Thanks

    • Tim
      Tim On October 27, 2010 at 9:35 AM

      @Rich If you are using Linear Workflow in C4D, then you need to comp in linear space too. In AE under project settings, enable the checkbox for Linearise Working Space.

      Hope that fixes your problem.

  10. peter lee
    peter lee On March 15, 2013 at 8:53 AM

    Thanks this solved my problem. I was getting the halo around text with drop shadow in Avid. Changed my export settings to straight and halo disappeared. cheers.

  11. Dave
    Dave On October 9, 2014 at 12:39 AM

    Great Tut! I still on wonder, how do I setup and export a premultiplied clip where the background is not black? I created a gray background on my composition and would like to keep it gray. Thanks!

    • admin
      admin On October 9, 2014 at 9:54 AM

      Hi Dave, I don’t think it is possible in After Effects, as soon as you save with an alpha channel the transparent areas are rendered black.

Leave a Reply