FORUMS: list search recent posts

Add mode and 32 bit

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
G. Scott Scribner
Add mode and 32 bit
on Oct 25, 2013 at 5:41:31 pm

Add, screen, color dodge and linear dodge don't seem to work correctly in AE CS6's 32 bit. These modes can all make an image darker or even black. If I understand any of these, they should only be able to lighten an image, never darken. To test, take two 50% grey solids, set the top to add mode - the comp'd image is white, correct. Apply levels to the top layer and slide it's input black point way down. You'll see the comp'd image get dark until it turns black. Really, ADD is making my image black? Something is very wrong here!

How can this be? Lighten and Lighten color still work normally.
Does anyone know why this would be?


Return to posts index

jim bachalo
Re: Add mode and 32 bit
on Oct 25, 2013 at 8:02:38 pm

Check project settings? This post by Stu Maschwitz is a must read

http://prolost.com/blog/2006/2/7/linear-color-workflow-in-ae7-part-1.html

You should follow me on Twitter here. My latest work


Return to posts index

G. Scott Scribner
Re: Add mode and 32 bit
on Oct 25, 2013 at 8:40:10 pm

I'm EMMY Nominated for Boardwalk Empire. There is nothing whacky in my project settings. This is a real problem with AE and it's math at 32 bit. I'll read the link, thanks.


Return to posts index


G. Scott Scribner
Re: Add mode and 32 bit
on Oct 25, 2013 at 8:54:40 pm

Ok, the link does not address this problem at all. In my experience as a professional working in a "project setting color space" brings in too many variables to be reliable. Like most other professionals who work in AE and log space we use a lut to view our images instead of depending on a project setting.

My problem is that I've pulled the highlights out of a bloody wound, darkening everything else then using ADD mode to make it pop. All looks great in 8 or 16 bit, but in float ADD does not work and the whole thing turns black. I've had to go to "lighten" which I'm not happy about. I cannot render in 16 bit as these images have ultrabrights to the tune of 1.8+.


Return to posts index

G. Scott Scribner
Re: Add mode and 32 bit
on Oct 25, 2013 at 9:02:55 pm

Photoshop does the same thing in 32bit. How can black be "added" to anything and be darker than the original?


Return to posts index

Darby Edelen
Re: Add mode and 32 bit
on Oct 25, 2013 at 9:08:58 pm

[G. Scott Scribner] "Photoshop does the same thing in 32bit. How can black be "added" to anything and be darker than the original?"

When you add a negative number it's called subtraction :)

Darby Edelen


Return to posts index


Darby Edelen
Re: Add mode and 32 bit
on Oct 25, 2013 at 9:10:26 pm

Sorry, here's a more helpful bit of info. Try turning the Clip Output Black property to "On" at least for the top layer.

Darby Edelen


Return to posts index

G. Scott Scribner
Re: Add mode and 32 bit
on Oct 25, 2013 at 9:39:46 pm

Never mind. I'm an idiot. I forgot about the "clip to output" options in levels. Turn on clipping and all is how it should be.


Return to posts index

Kevin Camp
Re: Add mode and 32 bit
on Oct 25, 2013 at 9:09:45 pm

it definitely seems like a bug, however it seems to be with levels... experimenting with curves seems to be working as expected.

doh! darby's right, and curves shows the same thing... (double doh!)


Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index


Conrad Olson
Re: Add mode and 32 bit
on Oct 25, 2013 at 9:18:23 pm

Yep, once you go to 32 bit float you have the possibility of values less than 0. If you are crushing blacks then they are dropping below 0.

This isn't a bug, it is the way float values work. You just need to be aware of it and clamp values at 0 where needed.

Curves and gamma do even weirder stuff sometimes as they usually pivot around 1 and 0, so you can think you are making everything brighter, but you can actually be darkening your superbrights (at least this happens in Nuke).

---

conradolson.com


Return to posts index

Walter Soyka
Re: Add mode and 32 bit
on Oct 25, 2013 at 9:58:43 pm

[G. Scott Scribner] "Add, screen, color dodge and linear dodge don't seem to work correctly in AE CS6's 32 bit. These modes can all make an image darker or even black."

As Darby and Conrad have pointed out, this behavior you're seeing with Add (and Linear Dodge, which is kind of Add by another name) is correct because of your use of negative numbers.

I'll add that mathematically, Screen and Color Dodge both necessarily assume input values between 0 and 1, because they work by inverting one or both of the layers -- that is, subtracting the value of the components of a layer from 1. With values above 1 or below 0, inversion is impossible and will give unexpected results, unless you clip. As such, these modes are poor choices for compositing in floating point in any application, unless you clip values. By clipping blacks to 0 and whites to 1, you gain the ability to invert an image (but of course, you lose all that dynamic range, so you may or may not want to do some range compression first and then expansion after the blend).

Lighten never darkens because it uses the maximum value of each of the two input sources' components, whereas Add can darken because adding a negative number to a positive number does not result in a higher positive number. Likewise, Subtract can actually brighten an image if you're subtracting negative values.

Basically, working in floating point removes an assumption (that all input values will be between 0 and 1) upon which some blend modes (and the common understanding of what they actually do) rests.

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Conrad Olson
Re: Add mode and 32 bit
on Oct 25, 2013 at 10:04:15 pm

I've never had issues using Screen in Nuke with values greater than 1 (assuming we don't have negative values), and we always work floating point.

---

conradolson.com


Return to posts index


Walter Soyka
Re: Add mode and 32 bit
on Oct 25, 2013 at 10:23:15 pm

I just looked up the math, and it turns out that Nuke's screen is non-traditional. Interesting!

Apparently Nuke does not use 1 - ((1-a) * (1-b)) for screen; instead, Nuke uses max(max(a,b), a+b-ab).

This protects against errors over 1, but introduces the possibility of clipping the low end.

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Conrad Olson
Re: Add mode and 32 bit
on Oct 25, 2013 at 10:36:30 pm

Good to know. Thanks for looking it up.

---

conradolson.com


Return to posts index

Todd Kopriva
Re: Add mode and 32 bit
on Oct 27, 2013 at 1:10:44 am

If you want us to consider changing the behavior (e.g., by adding an additional blending mode that behaves the way that Nuke's Add does), let us know with a feature request:
http://www.adobe.com/go/wish

> I'm EMMY Nominated for Boardwalk Empire. There is nothing whacky in my project settings.


I didn't realize that an Emmy nomination conferred infallibility. ;-)

---------------------------------------------------------------------------------------------------------
Todd Kopriva, Adobe Systems Incorporated
After Effects quality engineering
After Effects team blog
---------------------------------------------------------------------------------------------------------


Return to posts index


G. Scott Scribner
Re: Add mode and 32 bit
on Oct 28, 2013 at 6:16:17 pm

Yes, nominated, didn't win ... I was just trying to quickly say I know AE well. I rarely work in 32bit though, which is why I didn't remember that 32bit clip option. I didn't really know what it did before so I learned something here. Once I understood, it makes sense.

Say, if you're actually taking feature requests I have a bunch. You guys came to visit one day, asked me give you my list, then left ... didn't seem like you actually wanted to read it. If you do, I will send it.


Return to posts index

Todd Kopriva
Re: Add mode and 32 bit
on Oct 28, 2013 at 7:19:09 pm

> Say, if you're actually taking feature requests I have a bunch. You guys came to visit one day, asked me give you my list, then left ... didn't seem like you actually wanted to read it. If you do, I will send it.


We're always taking feature requests. Send them here:
http://www.adobe.com/go/wish

---------------------------------------------------------------------------------------------------------
Todd Kopriva, Adobe Systems Incorporated
After Effects quality engineering
After Effects team blog
---------------------------------------------------------------------------------------------------------


Return to posts index

Walter Soyka
Re: Add mode and 32 bit
on Oct 28, 2013 at 6:16:20 pm

[Walter Soyka] "Apparently Nuke does not use 1 - ((1-a) * (1-b)) for screen; instead, Nuke uses max(max(a,b), a+b-ab). This protects against errors over 1, but introduces the possibility of clipping the low end."

I presented this last week without explanation. I'll dive in and show how you can do this in After Effects.

Here's a screen blend in action:

[image]

To perform Screen blending, you invert both inputs, multiply them together, then invert the result:

[image]

a and b are our inputs. To invert something -- that is, to pivot the whole thing around middle gray (0.5), making white (1) into black (0), and black (0) into white (1), and also remapping all intermediate shades of gray, we can simply subtract the value of the input from white (1).

Inverting white (1-1) gives us black (0). Inverting black (1-0) gives us white (1). Inverting middle gray (1-0.5) gives us middle gray (0.5). Inverting a dark gray (1-0.25) will give us a light gray (0.75).

So, again, we invert both inputs a and b, giving us (1-a) and (1-b) to start with.

Then we multiply these together:
(1-a) * (1-b).

Then we invert the result -- that is, subtract it from 1:
1 - ( (1-a)*(1-b) )

We can build a screen in Ae with a few invert effects and the multiply blend mode:

[image]

If you go back to high school algebra, you may remember the technique for binomial multiplication: FOIL (first, outer, inner, last). Although our screen formula explains very clearly what it's doing, we can simplify it a bit mathematically.

1 - ( (1-a)*(1-b) )
1 - ( 1 - b - a + ab )
1 - 1 + b + a - ab
a+b-ab


That a+b-ab should be familiar -- it's in the Nuke math I mentioned above. Let's look at the Nuke Screen math again:

max(max(a,b), a+b-ab)

The max function means "take the larger of two values." So the Nuke Screen mode translates to English as follows: Take the larger of the larger of a and b and the result of a classic Screen.

More simply put, perform a classic screen, but if either input is brighter, use that instead.

There's already a simple max function in Ae -- it's the Lighten blend mode. That means we can roll our own Nuke-style Screen, by Screening A over B, then Lightening A and Lightening B over the results:

[image]

Using Lighten like this will preserve overbrights in float, but it will clip superblacks in one input if there is regular black (0) in the other, because max(0,-whatever) is always 0. You could use this double Lighten trick with the Add mode in float, too, to preserve overbrights and prevent subtraction on negative values.

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]