Site icon ProVideo Coalition

Color Management Part 18: Bit Depth

Color Management Part 18: Bit Depth 1

After Effects has a project-wide bit depth setting, but individual plugins may or may not support all bit depths. And when it comes to rendering, various file formats and codecs also have specific bit depth options.

When it comes to color management, bit depth is a technical setting that varies between different software apps and files, and can change the way that colors are stored and represented.  Having a basic understanding of bit depth can help avoid problems when working on projects and sharing files where color management is critical.

Overlooking 16 bits, the middle child

In the context of video production and animation, all recent developments in color management have revolved around two things: ACES, and High Dynamic Range.  In After Effects, working with HDR video requires projects to use the 32 bit float option.  In other words, 32 bit mode is linked to High Dynamic Range.  The video above is much longer than I thought it would be, but the aim is to try and keep the topics of bit depth and HDR separate.  However the underlying assumption is that the reason you would want to use 32 bit mode is so you can use HDR – and potentially ACES/OCIO as well.

From a modern and pragmatic perspective, the topic of bit depth in After Effects is focused on using 32 bit mode and not accidentally compromising any high dynamic range pixels.

Despite being a pretty mundane topic, there’s a lot of nuances involved when discussing bit depth and After Effects.  When After Effects was released in 1993 it only supported 8 bit color.  16 bit color was added 8 years later, and then 32 bit float mode a few years after that.  There are many potential combinations of project bit depth setting, plugin support, and output file format / codec settings that could be examined, but the end result would be an overwhelming mess.

Subsequently, while the differences between 8 bit and 16 bit mode are demonstrated in the video above, it’s not the main focus.  What we’re really concentrating on is the difference between regular “standard dynamic range” video, and high dynamic range.  The differences between 8 and 16 bit modes are not nearly as important as their differences to 32 bit float mode.

15+1 is not 16

…which is all leading up to a bit of an embarrassing apology about 16 bit mode. Because we’re mostly interested in 32 bit mode, I don’t feel so bad about posting a video that’s a bit wrong.  I’m kicking myself for making an amateur mistake, but I’m consoling myself with the thought that I haven’t messed up the underlying concept.

The video introduces the concept of bit depth, and shows how to calculate the number of values you have with a given number of bits.  When it comes to 16 bits, then 2^16 is 65,536 – or a range of 0 to 65,535.  In the video, I say that this means that each pixel can have a value from 0 to 65,535 – or 256 times more detail than an 8 bit project.  For other graphics software, this might be correct – and a 16 bit integer certainly does have a range of 0 to 65,535.

But in the specific case of Adobe graphics software – not just After Effects but Photoshop too – “16 bit” mode doesn’t mean what you think it might mean.  For technical reasons that have been examined more deeply elsewhere on the internet, Adobe are actually using “15+1” bits, giving a range of 0 to 32,768. This still gives 128 times more precision than a regular 0 – 255 bit pixel, and the underlying concept that more bits = less image banding still remain.

Warning! Warning!

Because After Effects wasn’t originally designed and written for HDR video, there are legacy parts and behaviours which don’t support 32 bit float mode.  This is the real problem that users need to be aware of – something as innocent as using the color dodge blending mode can result in all HDR pixels being clipped.  And while plugins have a warning icon if they don’t support the same bit depth of the project, even plugins that do support 32 bit float mode may clip HDR values by default.

If you manage to put together a 32 bit composition with high dynamic range images, when it comes to rendering you still need to ensure that you render to a file format and codec that isn’t clipping any HDR pixels.  Interestingly, After Effects will show a warning message if your output file will have a great bit depth than your project – rendering a Prores 4444 from an 8 bit project, for example.  In theory this should not be a problem, and the only consequence is that you might be wasting disk space and creating larger files than needed.  However doing the opposite – rendering to a codec that has a lower bit depth than the project – does not produce a warning.  But this is the scenario where image detail and quality may be compromised.

Clip go the shears

If you’re working in a 32 bit project, any plugins that don’t support 32 bit mode will show a warning icon in the Effects Controls panel.  All plugins also show their bit depth compatibility in the “Effects and Presets” panel.

However, as noted in the video, there are still a few other behaviors that can clip high dynamic range pixels in a 32 bit composition.  The main ones to be looking our for are:

Blending modes: Color Dodge, Classic Color Dodge, Vivid Light & Hard Mix

Plugins: Remove color matting, Noise

And the levels effect can be used to deliberately clip black and white pixels to 0 and 1.

Call the Nanny!

One downside to working with 32 bit float mode is the small potential for “NaN” pixels. A NaN pixel shouldn’t exist – NaN stands for “not a number” and they’re generally the result of a bug in the rendering code. They only seems to result from working with floating point numbers. Hopefully you’ll never encounter one, but it’s worth knowing that these evil bastards can cause all sorts of bizarre problems and behaviour.  The first time you encounter a NaN you’ll think you’re going crazy!

Luckily there’s a free solution in the form of a plugin you can download from fnord software, called “NaNny”.  For more information, check out an older article I wrote about them so you can recognise the symptoms if one should pop up.

This is part 18 in a long series on color management.  If you’ve missed the other parts, you can catch up here:

Part 1: The honeymoon is over

Part 2: Newton’s Prisms

Part 3: It’s all in the brain

Part 4: Maxwell’s spinning discs

Part 5: Introducing CIE 1931

Part 6: Understanding the CIE 1931 chromaticity diagram

Part 7: Introducing gamma

Part 8: Introducing Colorspaces

Part 9: The theory of a color managed workflow

Part 10: Using After Effects built-in color management

Part 11: Introducing OpenColor IO

Part 12: Introducing ACES

Part 13: OpenColorIO and After Effects

Part 14: Combining OCIO with After Effects

Part 15: Logarithmic file formats

Part 16: RAW video files

Unscripted: Looking at ACES and OCIO in After Effects 2023

Part 17: Linear Compositing

AND – I’ve been writing After Effects articles and tutorials for over 20 years. Please check out some of my other ProVideo Coalition articles.

 

Exit mobile version