[REBOL] Re: technology behind Morpheus ....
From: media:quazart at: 31-Oct-2001 13:42
----- Original Message -----
> > but I must ask one thing to be included as an effect word... a Matte
> > Divide (MDiv) function... (or at least a doc with a description of the
> > do perform it with several effects operations in the effects tree).
> > without it, PRACTICALLY ALL 3d rendered images using mattes will be
> > DESTROYED by comping. also note that if this subject isn't covered at
> > in part in the docs, you probably will get many support calls of the
> > of: "why does my image have a dark-grey edge?"...
> Could you provide a reference, please ?
on this page:
near the bottom, there is a link to download and install this file:
this is taken from parts of a general compositing bible... (who's reference
is also on that page)
The author, Mr Ron Brinkman who is recognized as a reference in the industry
(Whom I've met personally and is a very nice fellow) gave a seminar at
SIGGRAPH on compositing a while back... His book on compositing is
considered by many to be THE compositor's bible. It explains many advanced
compositing issues in extreme detail while keeping the language quite easy
to understand. Also note that he does not use ANY software as reference, he
explains the concepts by themselves... He also keep a nice friendly
approach in his writing style...
basically, when you have pre-multiplied images, you must divide the rgb
color value by the alpha channel. (or multiply its inverse ;-)
This text is quoted from Mr.Brinkman's file above when installed, chapter
5.3 The Image-Matte Relationship
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.
Example 24 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
NOTE: For slight color corrections, 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. "
I hope this helps...
if you have other questions... I'm always on the list!
Quaz'Art media design