Premultiplied questions.

Home Page forums Autodesk/Discreet Flame and Smoke Premultiplied questions.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #198943
    MCHEKA
    Participant

    I,d like to know what,s the real problem when i work with CG renders with the alpha premultiplied. The 3D crew gives me all the material rendered with the alpha premultiplied and when i import this material within Flame all works fine. Sometimes i use curves in the keyer to adjust the matte,s luminance or the borders, but i,m not sure what happen when the rendered material is or is not premultiplied. What,s the correct workflow?

    #206716
    augustzhuang
    Participant

    If you composite motion blur image or smoke or
    particle images, it will have some problem. And
    when you need to color correct the FG, it will sometimes
    have problems too.You can about below text from
    brinkmann’s book.

    You may come across the term ‘Premultiplied Image’, which refers to an image whose Red, Green and Blue channels have already been multiplied by a matte channel. This is almost always the type of element produced by 3D rendering software. You may also often wish to produce ‘Pre-Comped’, 4-channel elements that have already been pre-multiplied by their matte channel. You need to understand exactly how your compositing system deals with premultiplied elements. Some systems assume that the ‘Over’ operator will be fed such images by default, others may require that image and matte are brought in seperately and recombined before the ‘Over’ is performed. It is very important to understand that the relationship between image and matte can dramatically affect the results of an Over. Let’s look at some different scenarios. We’ll be using an example with a very soft-edged matte, since this is the most problematic situation.

    Consider Example 23. This is a premultiplied image over a background in a system that assumes you’re feeding it premultiplied images.

    is an Unpremultiplied image over a background in a system that assume you’re feeding it premultiplied images. Note that the foreground element, in areas where it’s matte is supposed to be Zero, is appearing as a ‘ghost’ image. If you were to check out the math of what is happening, you’ll see that in those areas of the result image, it is exactly the same as if we had simply added the two images together.

    Example 25 is a premultiplied image over a background in a system that assumes all images sent to it are not premultiplied. Such a system will automatically multiply the image by its matte channel. In this situation, we have effectively multiplied the image by its matte channel twice thereby darkening all areas of soft-edged matte. Consequently, there is a dark halo around the foreground.

    As you can see, dramatic problems can arise when you feed an Over something it doesn’t expect. The same sort of problems can arise when color-correcting premultiplied elements. In a premultiplied, 4-channel image, the image and the matte channels have a specific relationship that can cause compositing artifacts if altered.

    Because inevitably you will find yourself with a need to color-correct a premultiplied image, there is usually a tool on most systems to temporarily ‘undo’ the premultiplication, at least in the critical areas of the image. We will call refer to this tool by the rather unwieldy name of ‘Un-Premultiply’. Essentially, the tool re-divides the image by its own matte channel, which has the effect (except in areas where the matte is solid black, or zero) of boosting the areas which were attenuated by a partially transparent matte, back to approximately their original values. If your system does not have an explicit tool to perform this operation, you can hopefully use some other tool to ‘fake it’. For example, if there is a simple parsing language, you can do:
    R = R/M
    G = G/M
    B = B/M
    (and hope that you don’t get divide-by-zero errors).

    Once your image has been unpremultiplied, apply any necessary color-corrections. Then you can re-premultiply by the original matte channel, once again producing an element whose image-to-matte relationship is correct.

    NOTE: For slight colorcorrections, or when using images which have very hard-edged mattes, you may get perfectly acceptable results without going through this process. “If it looks correct, it is correct.


Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Copy link
Powered by Social Snap