WolframAlpha.com
WolframCloud.com
All Sites & Public Resources...
Products & Services
Wolfram|One
Mathematica
Wolfram|Alpha Notebook Edition
Finance Platform
System Modeler
Wolfram Player
Wolfram Engine
WolframScript
Enterprise Private Cloud
Application Server
Enterprise Mathematica
Wolfram|Alpha Appliance
Enterprise Solutions
Corporate Consulting
Technical Consulting
Wolfram|Alpha Business Solutions
Resource System
Data Repository
Neural Net Repository
Function Repository
Wolfram|Alpha
Wolfram|Alpha Pro
Problem Generator
API
Data Drop
Products for Education
Mobile Apps
Wolfram Player
Wolfram Cloud App
Wolfram|Alpha for Mobile
Wolfram|Alpha-Powered Apps
Services
Paid Project Support
Wolfram U
Summer Programs
All Products & Services »
Technologies
Wolfram Language
Revolutionary knowledge-based programming language.
Wolfram Cloud
Central infrastructure for Wolfram's cloud products & services.
Wolfram Science
Technology-enabling science of the computational universe.
Wolfram Notebooks
The preeminent environment for any technical workflows.
Wolfram Engine
Software engine implementing the Wolfram Language.
Wolfram Natural Language Understanding System
Knowledge-based broadly deployed natural language.
Wolfram Data Framework
Semantic framework for real-world data.
Wolfram Universal Deployment System
Instant deployment across cloud, desktop, mobile, and more.
Wolfram Knowledgebase
Curated computable knowledge powering Wolfram|Alpha.
All Technologies »
Solutions
Engineering, R&D
Aerospace & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Mechanical Engineering
Operations Research
More...
Finance, Statistics & Business Analysis
Actuarial Sciences
Bioinformatics
Data Science
Econometrics
Financial Risk Management
Statistics
More...
Education
All Solutions for Education
Tech & Trends
Machine Learning
Multiparadigm Data Science
High-Performance Computing
Quantum Computation Framework
Software & Web
Software Development
Authoring & Publishing
Interface Development
Web Development
Sciences
Astronomy
Biology
Chemistry
More...
All Solutions »
Learning & Support
Learning
Wolfram Language Documentation
Fast Introduction for Programmers
Wolfram U
Videos & Screencasts
Wolfram Language Introductory Book
Webinars & Training
Summer Programs
Books
Need Help?
Support FAQ
Wolfram Community
Contact Support
Premium Support
Paid Project Support
Technical Consulting
All Learning & Support »
Company
About
Company Background
Wolfram Blog
Events
Contact Us
Work with Us
Careers at Wolfram
Internships
Other Wolfram Language Jobs
Initiatives
Wolfram Foundation
MathWorld
Computer-Based Math
A New Kind of Science
Wolfram Technology for Hackathons
Student Ambassador Program
Wolfram for Startups
Demonstrations Project
Wolfram Innovator Awards
Wolfram + Raspberry Pi
Summer Programs
More...
All Company »
Search
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.
Enable JavaScript to interact with content and submit forms on Wolfram websites.
Learn how »