I have two files rendered out of 3D Studio max. One .AVI which is the RGB data, one .AVI which is the Alpha. The RGB data is already premultiplied as is proper, but AE has no way to use this properly.
Using the alpha as "Track Matte" doesnt work, you get dark fringe edges due to it AGAIN multiplying the already premultiplied RGB data with Alpha. I've tried "Set Channel" and "Set Matte" and god knows what else..... but I can't get it to work.
Can someone please tell me how on earth you do this?
It's as if I have the RGB data and the Alpha data of a premultiplied TGA file, only in SEPARATE FILES and I simply want to do the simple simple simple excercise of applying the RGB from one and ALPHA from the other. Can't be done.
/Z
-stev=o
-stev=o
Why don't you just render to a codec that supports full 32-bit RGBA channels
using straight alphas?
I have my reasons. Besides, straight alpha are the spawn of the devil. And besides again, it's beside the point. Sure there is "another way" to get the data out of my 3D program. But I have the data. The data is proper. I simply cannot get AE to interpret it correctly.
You can't set alpha interpretation options for a clip that doesn't have alpha. As soon as you set alpha, AE destroys your RGB channels by yet-again-multiplying them with alpha, in spite of my incessant trying to stop it from doing it.
I dunno how many times I have to say that AE's alpha handling is fundamentally flawed before it sinks in on this BB :) :) *grin giggle*
Just tell me how to do it. Anyone? PLEASE!
/Z
This yeilds the correct composit, so it is "possible" and the data is "right". Yet doing it that way is useless because I want to treat it as one unit, be able to blur, mask, etc. it. Can't do that with two layers.
All I want is to get this into one layer. And it's no fancy compositing, it's just plain old normal stuff. It's just a heavily motion blurred obeject and the black fringing in the blurred area is readily apparent.
With the workaround, it works correctly. I just repeatedly pray for AE to get this simple, trivial, 1985-ish technology thing *right*.
/Z
/Z
Using multiple copies of the alpha channel footage, or routing a single instance through different busses of a switcher or different levels of a plug-in, you can manipulate the pixel values in any area covered by any alpha value using different equations. Even the shadow on the weather map from the forecasters arm on the evening news comes from splitting off alpha channel information derived from the keyer into multiple copies that are mixed internally to produce a believable shadow. Using one instance of the footage it’s impossible to add the rgb values over black, screen the values between black and white, and use the values over white normally. A good programmer could write a plug in with 3 or more selectable value ranges and apply different operators or transfer modes to those ranges so you’d have only a single copy of your footage in the comp and a single plug-in applied. This would definitely clean up the timeline and probably speed up workflow. But it would still be using multiple copies of the footage internally, the same way a studio switcher does, to achieve the control needed for a seamless composite.
Every time I've seen the black fringe problem you describe it's been an error in interpretation of the footage, or an error in rendering settings for the alpha channel in the first place that causes the problem.
What you are describing though is final compositing. What if, (as is the case in Photoshop) I wanted to create a final product that had an alpha completely unrelated to the RGB? In Photoshop, I can take a black and white image or selection and save a new alpha channel. Imagine the mayhem if whenever I created a selection in Photoshop, the RGB automatically got chopped up or or otherwise changed as is the case with AE!
Even with multi layers you could create a circle in the alpha and a large overlapping square in the RGB as a final rendered quicktime movie from AE? If you can, please describe!
:)
Mike
By default, AE assigns an alpha channel to all layers and interprets the alpha as a straight alpha. You can use the set channels filter to ignore if you wish to ignore the alpha or change the mode on a particular layer.
If you choose to Pre-multiply on rendering or interpreting footage, the original RGB values are still not changed. The only thing that happens is that the values in the chosen background color are pre-multiplied with the values in the RGB channels when computations are made blending those values with underlying layers.
There are problems with the plug-ins that are used to render TGA sequences and Tiff sequences that are basic to their formats which can cause problems when rendering 32 bit (rgb + alpha or “Millions +”) from within AE, but these problems are not unique to AE and are present in every other app that I’ve ever used.
The background:
The RGB data, properly premultiplied:
The alpha:
This is what AE gives me:
This is what I want to see:
The "problem" lies in the fact that AE does not understand premultiplied data unless it is embedded in ONE SINGLE file, a .tga or .avi/.mov with alpha channel.
There is NO WAY to get AE to understand premultiplied when it comes from separate files.
Furthermore, when we say that AE changes the RGB data (which you claims it does not) we are talking about the OUTPUT rgb of the layer. In a premultiplied system, input RGB equals output RGB of the layer, and what we put in is exactly what we want out, and alpha only governs the scale factor for the background ONLY, not the foreground. Alpha should NOT have an impact on foreground in premultiplied mode!!!!!!
/Z
If you simply screen the rgb layer over the background all of the white pixels will properly blend with the background. This is not an acceptable solution because of the colors at the end of the shaft of light.
If you use luma matte to extract an alpha channel from the rgb image, render the combination and import the footage with an alpha, and then choose luminescent premultiply as the transfer mode you’ll get exactly what you want.
Since I don’t have the app you used to render the rgb image,(I assume it’s a light saber) I cant exactly duplicate it, but I’d bet if you rendered as a straight alpha (not pre-multiplied) and then brought the pieces into AE as a rgb layer, an alpha layer, and your bg you’d get exactly what you have in the bottom frame. The problem with the files you posted is that the rgb image is pre-multiplied with the black and the rgb pixels are changed from their original color. Luminescent premultiply transfer mode is the only way to clean out the black. --- As I said before – it’s an alpha channel that wasn’t rendered properly.
The problem I see here is that your "pre multiplied” rgb and your alpha
don’t match. The pre-multiplied RGB has black in the partially transparent
pixels because the program you used to render these pixels added in black
values.
Exactly; That is precicely the proper appearance of a premultiplied file. Remember, in a premultiplied file, the RGB data already "looks correct".
One of the hundreds major advantages of premultiplied vs. straight, is that the RGB data is directly viewable and will look completely correct as the final image upon a black background.
This is all completely correct, and the flaw in handling this completely correct image lies within AE.
The alpha channel properly sets values for all pixels, but the white ones
you want to add to the background are not white, but various shades of
gray (and colors for the handle) because they have been mixed with the
background layer
Exacly - because it's *premultiplied*, Rick. Stop thinking in terms of Straight alpha.
In a straight alpha system, 50% transparent white (i.e. a color which in the final image ends up 50% gray and 50% of the background) is, in RGBA data (ranges 0-1) "1, 1, 1, 0.5", but in a premultiplied system, 50% transparent white is "0.5, 0.5, 0.5, 0.5".
You see ANOTHER of the hundreds of advantages of prem.alpha is that "all channels are created equal" and an operation you do to one, you do to them all. So to to make the pixel 50% transparent you simply divide ALL components (not just the alpha) by two.
It's Premultiplied! REAL alpha. The way God meant it to work :-) (Okay, just kidding, but the way Jim Blinn, Ed Catmull and Alvy Ray Smith, the people who actually invented the damned thing, meant it to work, and yes, I asked myself)
Since I don’t have the app you used to render the rgb image,(I assume
it’s a light saber)
It happens to be that, yes. Sorry for all my examples *incidentally* happen to be around lightsabers :-) pure coincidence actually.... don't go all elite on me just because I happen to be doing lightsabres.... but.... Rick... you [b]don't have 3D studio?[/b] I thought you said you did!
Here's how to get these results out of 3D studio:
1. make a really motion blurred object which is 100% self-illuminated.
2. Render it to a .JPG file or ANY other pure "RGB" format. *not* any format that inherently includes alpha.
3. In "Render Elements" in the Render dialog, render Alpha separately. Surely you done this some day? (I use render elements all the time to get my stuff in layers for compositing later.)
You will get files precicely as these.
/Z
There's black added to the pixels you’re trying to lay over the background because you put them there in 3DS when you rendered pre-multiplied. Luminescent premultiply will remove the black and screen the lighter pixels properly over the bg layer.
You wanted a solution and I gave you one. Here is another one.
Place your alpha on layer 1 and turn off visibility. Place the rgb image on layer 2, and the background on layer 3. Apply Set Matte to the rgb image (layer 2) and pick layer 1 for the source. Choose luminance for the values, leave everything else at the default settings. Set the transfer mode to luminescent premultiply for layer 2 and you’ve got exactly what you show as the composite you want. You can add masks, pre-compose and collapse transformations, or do anything else you want with the layers now and everything will work.
I don’t own 3DSmax but I get files from other contractors all the time rendered from this program. Everything I get from them is rendered with straight alphas. Everything I render for online, AVID, or any other is rendered with straight alphas. It’s a better way to work.
By the way, if you put your background plate in 3dS and rendered premultiplied you’d end up with another mess because you can only premultiply using one color value from the background.
I’m not going to debate this anymore. You wanted a solution and I have given you two. If you want to write a plug-in ( I seem to remember that you said you have been programming for years in other posts) that separates out values in ranges, applies different transfer modes to the pixels masked by those ranges, or whatever you want AE to do with the alpha information then be my guest. The SDK is available for free from ADOBE. If you want to lobby Adobe for a major change in the way alphas are treated by default then be my guest. Write to them, get on the Beta team and argue your point. I haven’t got the time or energy to pursue this debate further.
There's no need to get rude here.
If you perceived what I wrote as rude, I apologize. It was intended a bit more "tounge in cheek" than rude, I must say!
Luminescent premultiply will remove the black and screen the lighter pixels
properly over the bg layer.
Luminicent premultipled has all sorts of buggy problems. And it's still *beside the point*. It's not a *solution*, it's a *work around*. "Umult" on the layer is more of a *solution* but it's embarresing that this doesnt exist in core AE!
I don’t own 3DSmax but I get files from other contractors all the time
rendered from this program. Everything I get from them is rendered with
straight alphas.
That's possible that, but you quite probably get it rendered with RGBA in a signle file, which AE interpretes correctly regardless of straight or premultiplied.
It’s a better way to work.
Why?
- the math is more complicated
- data in the RGB channels when alpha is zero is unused and wasted
- etc.
Please motivate this statement. Why is it better? And why is all the founding fathers of Computer Graphics not agreeing with you?
By the way, if you put your background plate in 3dS and rendered premultiplied
you’d end up with another mess because you can only premultiply using
one color value from the background.
THAT is quite true! But you don't.
If you want to lobby Adobe for a major change in the way alphas are treated
by default then be my guest.
I am. Havn't you noticed ;)
/Z
Set the transfer mode to luminescent premultiply for layer 2 and you’ve
got exactly what you show as the composite you want. You can add masks,
pre-compose and collapse transformations, or do anything else you want
with the layers now and everything will work.
You didn't actually try this, did you?
Try this. Then add a mask to the rgb layer. Nothign happens. Try adding a quick blur to the object layer. Instant mess.
For the record, though - If I do *pre compose* these layers and apply masks and blurs to the precomposite, it DOES work, however.
But isn't this an awful lot of hoops to jump through to get a simple thing right?
Wouldn't a simple checkbox for, say, "Set Channel" or "Track Matte" or whichever of them you choose that says "interpret rgb data as premultiplied" be a lot easier on everyones hair?!?!?!
/Z
Comments? Corrections?
Well said Joseph!
Mike
I especially like the phrasing about "combating the unnecessary multiply with an equally unnecessary divide", which is precicely the hoops one is left to jump through to get this stuff right.
Straight alphas makes sense ONLY when the originating data comes from a real world image out of which you want to *extract* something.... straight alphas does not make sense when you already have a proper image with proper RGB data in it, i.e. when it comes from a computer rendering software. There only "premultiplied" makes sense. Making the file 'straight' by imposing the 'needless divide' is an UGLY KLUDGE FIX stinking of bad workaround slime so bad that one never, as a rendering software developer, should have to contemplate doing, yet have been forced to do for decades due to bad compositing software coders only thinking about 'real world' originating imagery!!!
/Z
I don't know if this might solve your single layer problem. Steven Walker has a plugin called Composite. It's $20. It has alpha tools and and all of AE's transfer modes in an effect. Which means that you can apply the Lumenisent Premultiply and effects to the same layer. I tried it out on some the sample images you've posted and it seems to do the job.
<http://www.walkereffects.com>
You should check it out.
-stev=o
You can "do" this in a million ways with various workaround. You shouldn't have to. THAT is the point.
/Z
I thought you were looking for a method to do it in a comp with only two layers a foreground and background. Using you're graphics. I tried with the files in this thread and seemed to have gotten the result you are looking for, and the plugin is only $20.
I thought that was the point you didn't want to have 3 layers or to have to apply the alpha to the background.
As for your assertion that this should be a bread and butter function of AE, why is that so many here have had to have the problem pointed out to them? Would it not have been readily apparent to them?
(Sigh) I don't know, I guess you've got a point about AE working internally only as straight alpha. All I can say is that this has never been an issue for me. Yes I do composite 3D graphics into AE. But again I've never rendered 3D and it's alpha separatly. The file had the alpha with it.
Jim
The only probelm that exists using this transfer mode is a render pipeline issue. Don't expect Adobe to sit on their render pipeline issues forever.(basic text for example) I expect that it will be solved in the near future.
Now add the "Remove Color Matting" effect to the precomposed layer, and select black.
This will "un-premultiply" your 3D output, the same thing that would happen if you had the alpha embedded in a movie and could select that in the interpolation settings for the footage.
As for your assertion that this should be a bread and butter function
of AE, why is that so many here have had to have the problem pointed out
to them? Would it not have been readily apparent to them?
Because, for decades, rendering software people have been forced to output mangled data (i.e. "straight alpha" junk) to comply to the mangled behavior of compositors.
It's just that it's unelegant. It's a workaround on top of a workaround already. It's ugly. It's bad. It's wrong. It stinks :)
I like elegance and simplicity, and that is what I would like. Just a toggle on a layer to tell the layer to behave in a premultiplie manner would be a start. Or a toggle in the comp to behave in proper premultiplied mode, for example.
/Z
If you rendered your RGB AVI file with a black background then that is
what your seeing around the edges of your composite, not the alpha being
premultiplied with the RGB image or whatever you said.
This is straight alpha thinking.
You have to understand how an alpha channel works in conjunction with
antialiasing.
I understand perfectly well how an alpha channel works in conjunction with antialiasing, both straight and premultiplied style. You show clear indication of only understanding straight style.
You see, when you rendered your original on a dark background the antialiasing
multiplies with the black in the BG and causes grey colored pixels where
there would be transparency.
That is a straight alpha interpretation. My interpretation is that it causes a gray pixel PLUS transparency (in the alpha channel). The gray pixel is correct, heck, if the pixel is halfway covered with a white object it shuld be 50% gray, shuldn't it? So why make it 100% white and 50% in the alpha? Doesnt make sense. Make it 50% gray as it should, and put the 50% of transparency in the alpha. That's how premultiplied alpha works. Makes a lot more sense and makes your RGB data immediately viewable as-is with a correct image.
When you use the alpha info, the antialiasing in the alpha takes those
pixels at a lesser value than 100%
But in the premultiplied world the alpha value ONLY tells us how much background to let through, nothing else. The alpha does not affect the foreground RGB data at all when compositing.
Not only is this faster to calculate (less multiplications), it's more useful (your image has the correct RGB data for direct viewing), it also allows the extended gamut of semi-additive comping (but nobody seems to care about this fantastic feature, sigh)
THATS WHY WE USE STRAIGHT ALPHAS IN THE PROFESSIONAL WORLD
ILM always works with premultiplied alpha, you know. Their own OpenEXR file format for high dynamic range images defines alpha as premultiplied.
, and I'm glad your not my employee rendering 2x as many files as you
need
That's a storage issue, I am using the best compression on each type of imagery. And they are rendered at once, so there is no extra time taken, and the space is smaller.
/Z
No, I fully understand how a white pixel at 50% transparency will appear 50% grey against a black background. Make two layers in photoshop, 1 white and 1 50% grey. Now turn down the opacity to 50% and see if those two colors are the same. Needless to say, they are not. An alpha is a greyscale representation of transparency only. If there is a pixel in the antialiasing that is 50% white in the alpha, that means it will choose 50% of the pixel in the corresponding RGB image. If that color is white (straight alpha) it will be like turning down the opacity to 50% on a white layer. If you premultiplied your original on a dark background you will see a dark ring and complain about AE on this forum. I'm not sure why you think straight alpha channels are the devil when they look the best when brought back into pretty much any compositing software out there. When do you use an element with an alpha channel before compositing it? I work in TV, so its never a worry. Everything we put into our Avid systems has a straight alpha cause it looks better when composited, and thats all that matters to our company.
The problem is that you insist on thinking about a black background, where I refuse to do so. This "premultiplied with 'insert color here'" is ANOTHER spawn of the devil, you know.
The background in a proper premultipled file is not "black", it is a NULL background. It has no color. It is a void. The void has no R, G, B or Alpha.
The thinking that I "already multiplied my file with a black background" is inherently flawed thinking, is conceptually wrong. This has not occured. Again it's that badly chosen name "pre-multiplied" creaping up inducing in our brain a falsehood.
What I have is a file containing the proper RGB data over the proper Alpha mask, where the alpha when composited will apply to the background only. I have to say this again to let it sink in, premultiplied alpha only defines the amount of transparency the pixel has, i.e. the percentage of BACKGROUND needed. It has NO impact on foreground. It applies to the background ONLY.
ILM uses premultipled alpha. Pixar uses premultiplied alpha. I can hardly think of any REALLY big boy who willingly uses straight alpha other than those who are "forced" to do so by using crappy software that insists on using it (i.e. AE).
And yes, I attest that in perhaps 85% or even 90% of your run-of-the-mill compositing work it doesn't matter which you use, as soon as your application can interpret it correctly.
My problem with AE in this regard are these:
1. AE can only "understand" premultiplied alpha (semi)properly when it comes in as ONE file. If you, for whatever reason, have them separate, you have to jump up and down and in circles to get AE to actually understand the data.
2. PROPER interpretation of a premultiplied file is the composite equateion (comp = fg + (1 - alpha) * bg) and this gives us a WHOLE GAMUT of additive and semi-additive compositing FOR FREE which AE does not support in any way, except partially and very poorly, using the "Luminecent premultipled" transfer mode. And note that AE programmers have the glorous NERVE to call this whole gamut of functionality "illegal". That's pretty hilarious.
ILM is on my side. Pixar is on my side. The guy who invented alpha channels, Alvy Ray Smith, is on my side. Who else do I need?
/Z
/Z
Paul -- one long "word" for you:
<http://www.digitalartform.com/alphaChannel.htm>
tony
* kisses to Adobe*
Just have to check my wallet.
* moths fly out*
:(
/Z