WOLFRAM
Products
Wolfram|One
Mathematica
Wolfram Notebook Assistant + LLM Kit
Wolfram|Alpha Notebook Edition
System Modeler
All Products
Consulting & Solutions
Wolfram Consulting
Industry Solutions
Solutions for Education
Learning & Support
Wolfram U Courses
Wolfram Language Resources
Wolfram Community
Support FAQs
Contact Support
Company
About Wolfram
Careers
Events
Educational Programs
All Sites and Resources
Wolfram|Alpha
Wolfram Cloud
Your Account
Your Account
User Portal
Search
Close
Enable JavaScript to interact with content and submit forms on Wolfram websites.
Learn how
Legacy Documentation
Digital Image Processing
(2000)
This is documentation for an obsolete product.
Current products and services
User's Guide
Point Operations
3.2 Luminance Quantization
Any analog signal that is to be processed by a computer must be converted to a suitable binary code. In practice this usually means a signed integer. The process of converting analog-valued signal samples to discrete-valued samples is known as quantization. A digital image is thus a quantized approximation of the original signal entering an optical system. The range of integers available for signal quantization is known as luminance resolution and is determined by the number of binary digits used to represent each image sample value. It is typical to use 8 bits-per-pixel (bpp), therefore pixel values are integers in the range
8
={0,1,...,255}. Some high-end digital cameras output 10 and 12 bpp for improved luminance fidelity.
The concept of quantization may also be applied to digital signals. The goal is to reduce the number of bits needed to represent a given signal sample with hopefully little or no visible distortion. This leads to a reduction of storage requirements or equivalently a decrease in transmission time, so quantization is of great interest in the context of data or image compression. Quantization also arises naturally in the context of displaying and printing images on binary media such as paper. Finally, quantization at the level of 1 bpp, called binary thresholding, is a very common first step in many image processing algorithms and applications.
UniformQuantizer
[
img
,
]
gives
img
with all elements quantized using step size
UniformQuantizer
[
img
,
,
d
]
gives
img
with all elements quantized using step size
and offset by
d
Quantization function.
This loads the package.
In[1]:=
This shows the transfer function of a uniform quantizer, with step size
=32.
In[2]:=
Out[2]=
This illustrates the effect of reducing the luminance resolution of an image. First we load an example monochrome image and extract a small subregion.
In[3]:=
Here we quantize and display the example image. Shown are the original image and, clockwise, quantized copies of the original at 16 levels, 4 levels, and 2 levels. This simulates 4, 2, and 1 bpp representations, respectively, of the original 8 bpp example image.
In[4]:=
Out[4]=
The preceding example demonstrates a phenomenon called contouring, which becomes visible when the number of quantization levels is insufficient. In flat regions of an image, this tends to occur at about 6 bpp.