Knowledge base

16. Floating Point vs Integer


What are integer and floating point values?

Integer values, i.e. 0-255

Black = 0, White = 255

Floating point values are 0-1

Black = 0, White = 1

 

integer_vs_floating-point_slides_v04bs_1ss_bw

Integer 8-bit

Black = 0, White = 255

Only exact integer values, no fractions

8-bit can store 256 values per channel


integer_vs_floating-point_slides_v04bs_3ss_bw

Floating Point

Black = 0, White = 1

Value fractions such as 0.57328 are possible

32-bit can store 4 billion values per channel


integer_vs_floating-point_slides_v04bs_p4b_crop_750_v2

Super Blacks and Whites

Values below black and above white are allowed in floating point, not with integer values


More Values?

So floating point gives me a lot more values?

32-bit gives us a lot more values, floating point allows us to work between 0 and 1, and with exceeding values, under 0 and over 1.


Super Blacks and Super Whites

In integer, exceeding values are clipped, 75% grey + 75% grey = white (255). Lowering the exposure won’t bring back any values over white. Integer formats cannot store values above white

In floating point, exceeding values are not clipped 75% grey + 75% grey = white (1.5). Lowering the exposure can bring back all values over white

Being able to work and store values exceeding white or black is a huge advantage for all aspects of our workflow, from rendering, to compositing and to final color correction

 

overexposed
Overexposed Image

About 3 stops overexposed

Saved from a 32-bit workspace as

A – Integer file (TIFF 8 or 16-bit)

B – Floating point file (TIFF 32-bit)

underexposed_interger
A – Integer File

Lowering the exposure 3 stops down is not pretty

Values over white can’t be brought back, they’re clipped

underexposed_float
B – Floating Point File

Lowering the exposure 3 stops down works

All values over white can be brought back


Why not just work with floating point values then?

Exactly, that’s what we should do, and that’s what the VFX community already does, working with Nuke and the OpenEXR file format. Only a few formats can store floating point values: OpenEXR, TIFF in 32-bit and Radiance

Check out the file format list in the bit depth chapter


Example Setups

Contains the overexposed images to try yourself

Nuke Script and Images

Photoshop File