Peak signal-to-noise ratio (PSNR) is an engineering term for the ratio between the maximum possible power of a
signal
A signal is both the process and the result of transmission of data over some media accomplished by embedding some variation. Signals are important in multiple subject fields including signal processing, information theory and biology.
In ...
and the power of corrupting
noise
Noise is sound, chiefly unwanted, unintentional, or harmful sound considered unpleasant, loud, or disruptive to mental or hearing faculties. From a physics standpoint, there is no distinction between noise and desired sound, as both are vibrat ...
that affects the fidelity of its representation. Because many signals have a very wide
dynamic range
Dynamics (from Greek δυναμικός ''dynamikos'' "powerful", from δύναμις ''dynamis'' " power") or dynamic may refer to:
Physics and engineering
* Dynamics (mechanics), the study of forces and their effect on motion
Brands and ent ...
, PSNR is usually expressed as a
logarithm
In mathematics, the logarithm of a number is the exponent by which another fixed value, the base, must be raised to produce that number. For example, the logarithm of to base is , because is to the rd power: . More generally, if , the ...
ic quantity using the
decibel
The decibel (symbol: dB) is a relative unit of measurement equal to one tenth of a bel (B). It expresses the ratio of two values of a Power, root-power, and field quantities, power or root-power quantity on a logarithmic scale. Two signals whos ...
scale.
PSNR is commonly used to quantify reconstruction quality for images and video subject to
lossy compression
In information technology, lossy compression or irreversible compression is the class of data compression methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data size ...
.
Definition
PSNR is most easily defined via the
mean squared error
In statistics, the mean squared error (MSE) or mean squared deviation (MSD) of an estimator (of a procedure for estimating an unobserved quantity) measures the average of the squares of the errors—that is, the average squared difference betwee ...
(''MSE''). Given a noise-free ''m''×''n'' monochrome image ''I'' and its noisy approximation ''K'', ''MSE'' is defined as
:
The PSNR (in
dB) is defined as
:
Here, ''MAX
I'' is the maximum possible pixel value of the image. When the pixels are represented using 8 bits per sample, this is 255. More generally, when samples are represented using linear
PCM with ''B'' bits per sample, ''MAX
I'' is 2
B − 1.
Application in color images
For
color images with three
RGB values per pixel, the definition of PSNR is the same except that the MSE is the sum over all squared value differences (now for each color, i.e. three times as many differences as in a monochrome image) divided by image size and by three. Alternately, for color images the image is converted to a different
color space
A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital represe ...
and PSNR is reported against each channel of that color space, e.g.,
YCbCr
YCbCr, Y′CbCr, also written as YCBCR or Y′CBCR, is a family of color spaces used as a part of the color image pipeline in digital video and digital photography, photography systems. Like YPbPr, YPBPR, it is based on RGB primaries; the two ...
or
HSL.
Quality estimation with PSNR
PSNR is most commonly used to measure the quality of reconstruction of lossy compression
codec
A codec is a computer hardware or software component that encodes or decodes a data stream or signal. ''Codec'' is a portmanteau of coder/decoder.
In electronic communications, an endec is a device that acts as both an encoder and a decoder o ...
s (e.g., for
image compression
Image compression is a type of data compression applied to digital images, to reduce their cost for computer data storage, storage or data transmission, transmission. Algorithms may take advantage of visual perception and the statistical properti ...
). The signal in this case is the original data, and the noise is the error introduced by compression. When comparing compression codecs, PSNR is an ''approximation'' to human perception of reconstruction quality.
Typical values for the PSNR in
lossy
In information technology, lossy compression or irreversible compression is the class of data compression methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data size ...
image and video compression are between 30 and 50 dB, provided the bit depth is 8
bits, where higher is better. The processing quality of 12-bit images is considered high when the PSNR value is 60 dB or higher. For 16-bit data typical values for the PSNR are between 60 and 80 dB. Acceptable values for wireless transmission quality loss are considered to be about 20 dB to 25 dB.
The maximum PSNR for 8 bit is 48.131, for 10 bit is 60.198, for 12 bit is 72.245.
In the absence of noise, the two images ''I'' and ''K'' are identical, and thus the MSE is zero. In this case the PSNR is infinite (or undefined, see
Division by zero
In mathematics, division by zero, division (mathematics), division where the divisor (denominator) is 0, zero, is a unique and problematic special case. Using fraction notation, the general example can be written as \tfrac a0, where a is the di ...
).
Performance comparison
Although a higher PSNR generally correlates with a higher quality reconstruction, in many cases it may not. One has to be extremely careful with the range of validity of this metric; it is only conclusively valid when it is used to compare results from the same codec (or codec type) and same content.
Generally, when it comes to estimating the
quality of images and
videos as perceived by humans, PSNR has been shown to perform very poorly compared to other quality metrics.
Variants
PSNR-HVS is an extension of PSNR that incorporates properties of the human visual system such as
contrast perception.
PSNR-HVS-M improves on PSNR-HVS by additionally taking into account
visual masking.
In a 2007 study, it delivered better approximations of human visual quality judgements than PSNR and
SSIM by large margin. It was also shown to have a distinct advantage over
DCTune and PSNR-HVS.
See also
*
Czenakowski distance
*
Data compression ratio
*
Perceptual Evaluation of Video Quality (PEVQ)
*
Structural similarity index measure (SSIM)
*
Subjective video quality
Subjective video quality is video quality as experienced by humans. It is concerned with how video is perceived by a viewer (also called "observer" or "subject") and designates their opinion on a particular video sequence. It is related to the fie ...
*
Video Multimethod Assessment Fusion
*
Video quality
Video quality is a characteristic of a video passed through a video transmission or processing system that describes perceived video degradation (typically compared to the original video). Video processing systems may introduce some amount of disto ...
References
{{Machine learning evaluation metrics
Image compression
Noise (graphics)
Film and video technology
Digital television
Engineering ratios