Quantization

From Odwiki

Jump to: navigation, search

A computer represents numbers with a fixed amount of precision. For example, one byte (8 bits) can store up to 256 individual values. A 16 bit integer can store up to 65536 individual values, etc.

A computer can represent a single precision floating point number with about 6-7 decimal digits of precision using 32 bit words. However, storing the full floating point resolution is not all that practical since it will consume lots of disk space (even compressed).

Quantization is the process of taking a high-precision value and choosing a lower precision representation (lossy) form of the value.

For example, we might take all floating point numbers between 0 and 1 and quantize these to 256 different levels. This means that the floating point value could be stored (with less precision) in 8 bits of data. An immediate savings of 4 times the storage.

In order to quantize color values, there are usually several controls

  • The white point (where the floating point value of 1 gets mapped to)
  • The black point (where the floating point value of 0 gets mapped to)
  • The number of quantization levels (how many different values can be represented)

A common quantization in film ProductionsUsingHoudini is to use 16 bit integers to represent the color values. This gives 65536 individual values which can be stored. However, the human eye is really only able to differentiate between several thousand levels, so this gives a lot of "head room". Since images may be brightened, blurred or affected in compositing, having extra information about the accurate representations of the colors is useful

  • White point = 4095 (anything larger than 4096 in the image file will be brighter than 1)
  • Black point = 0
  • Quantization Levels = 65536

For example, if we had the floating point color { 0.5, 1.5, 3.0 }, this could accurately be represented by the 16 bit values { 2047, 6142, 12285 }. This way, if the compositor felt that the image were too bright, they would be able to darken the image and get an accurate color representation.

Lately, there has been a trend to use 16-bit floating point representations (see OpenEXR). This is the same process as above in that precision is lost during the quantization. However, a 16 bit floating point representation allows for easier manipulation of the images, without worrying about black/white points.

© 2009 od[force].net | advertise