Quantization (image processing): Difference between revisions

Content deleted Content added
No edit summary
Ashkyd (talk | contribs)
mNo edit summary
Line 1:
'''Quantization''', involved in [[image processing]], is the process seeking to reduce the number of colors required to represent an [[image]].
 
The infinite number of colors available through the lens of a camera is impossible to display on a computer screen. Since a computer can display only a finite number of colors, quantization is always necessary.
is impossible to display on a computer screen.
Since a computer can display only a finite number of colors, quantization is always necessary.
 
Many early computers were very limited in the number of colors they could display at one time -- commonly 16 (and later 256) colours. Modern computers can now display millions of colours at once, far more than can be distinguished by the human eye.
However, modern computers can usually display far more colors than are humanly distinguishable.
 
Most quantization algorithms allow you to set exactly how many colors you want to use. With the few colors available on early computers, different quantization algorithms produced very different-looking output images. As a result, a lot of time was spent on writing sophisticated algorithms to be more lifelike. Nowadays almost every algorithm produces an output indistinguishable from the view through the camera lens.
 
== Quantization in File Formats==
When you set the very small number of colors available on early computers,
Although more frequent in the past, nowadays color quantization with pallets of lower than 256 colours is mainly used in [[GIF]] and [[PNG]] images. Using "nearest-neighbor" quantization and allowing fewer colours usually results in smaller file sizes, however sophisticated "random dithering" can actually inflate the final size.
different quantization algorims produced very different-looking output images.
 
So people spent a lot of time trying to make sophisticated quantization algorithms that gave the impression of being the most "lifelike".
 
When you set the very large (but still finite) number of colors available on a modern computer,
just about every quanization algorithm produces an output image
indistinguishable from the human eye
from every other quantinization algorithm and from the view through the lens directly.
 
Although more frequent in the past, currently color quantization is only used in 8-[[bit]] (256 color) images, as [[GIF]] images and some [[PNG]] images.
 
Using "nearest-neighbor" quantization, the fewer colors you allow, the small the PNG file becomes.
On the other hand, sophisticated "random dithering" can actually inflate PNG file size.
 
A standard quantization [[algorithm]] works in 2 steps: