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 for storing, handling, and transmitting content. The different versions of the photo of the cat on this page show how higher degrees of approximation create coarser images as more details are removed. This is opposed to lossless data compression (reversible data compression) which does not degrade the data. The amount of data reduction possible using lossy compression is much higher than using lossless techniques.
Well-designed lossy compression technology often reduces file sizes significantly before degradation is noticed by the end-user. Even when noticeable by the user, further data reduction may be desirable (e.g., for real-time communication or to reduce transmission times or storage needs). The most widely used lossy compression algorithm is the
Lossy compression is most commonly used to compress
Types
It is possible to compress many types of digital data in a way that reduces the size of a computer file needed to store it, or the bandwidth needed to transmit it, with no loss of the full information contained in the original file. A picture, for example, is converted to a digital file by considering it to be an array of dots and specifying the color and brightness of each dot. If the picture contains an area of the same color, it can be compressed without loss by saying "200 red dots" instead of "red dot, red dot, ...(197 more times)..., red dot."
The original data contains a certain amount of information, and there is a lower bound to the size of a file that can still carry all the information. Basic information theory says that there is an absolute limit in reducing the size of this data. When data is compressed, its entropy increases, and it cannot increase indefinitely. For example, a compressed ZIP file is smaller than its original, but repeatedly compressing the same file will not reduce the size to nothing. Most compression algorithms can recognize when further compression would be pointless and would in fact increase the size of the data.
In many cases, files or data streams contain more information than is needed. For example, a picture may have more detail than the eye can distinguish when reproduced at the largest size intended; likewise, an audio file does not need a lot of fine detail during a very loud passage. Developing lossy compression techniques as closely matched to human perception as possible is a complex task. Sometimes the ideal is a file that provides exactly the same perception as the original, with as much digital information as possible removed; other times, perceptible loss of quality is considered a valid tradeoff.
The terms "irreversible" and "reversible" are preferred over "lossy" and "lossless" respectively for some applications, such as medical image compression, to circumvent the negative implications of "loss". The type and amount of loss can affect the utility of the images. Artifacts or undesirable effects of compression may be clearly discernible yet the result still useful for the intended purpose. Or lossy compressed images may be '
Transform coding
Some forms of lossy compression can be thought of as an application of
The most common form of lossy compression is a transform coding method, the
In the case of audio data, a popular form of transform coding is
From this point of view, perceptual encoding is not essentially about discarding data, but rather about a better representation of data. Another use is for
Information loss
Lossy compression formats suffer from
There are two basic lossy compression schemes:
- In lossy transform entropy coded.
- In lossy predictive codecs, previous and/or subsequent decoded data is used to predict the current sound sample or image frame. The error between the predicted data and the real data, together with any extra information needed to reproduce the prediction, is then quantized and coded.
In some systems the two techniques are combined, with transform codecs being used to compress the error signals generated by the predictive stage.
Comparison
The advantage of lossy methods over
Emotional effects
A study conducted by the Audio Engineering Library concluded that lower bit rate (112 kbps) lossy compression formats such as MP3s have distinct effects on timbral and emotional characteristics, tending to strengthen negative emotional qualities and weaken positive ones.[6] The study further noted that the trumpet is the instrument most affected by compression, while the horn is least.
Transparency
When a user acquires a lossily compressed file, (for example, to reduce download time) the retrieved file can be quite different from the original at the
Compression ratio
The compression ratio (that is, the size of the compressed file compared to that of the uncompressed file) of lossy video codecs is nearly always far superior to that of the audio and still-image equivalents.
- Video can be compressed immensely (e.g., 100:1) with little visible quality loss
- Audio can often be compressed at 10:1 with almost imperceptible loss of quality
- Still images are often lossily compressed at 10:1, as with audio, but the quality loss is more noticeable, especially on closer inspection.
Transcoding and editing
An important caveat about lossy compression (formally transcoding), is that editing lossily compressed files causes
Editing of lossy files
By modifying the compressed data directly without decoding and re-encoding, some editing of lossily compressed files without degradation of quality is possible. Editing which reduces the file size as if it had been compressed to a greater degree, but without more loss than this, is sometimes also possible.
JPEG
The primary programs for lossless editing of JPEGs are (which provides a Windows interface).
These allow the image to be cropped, rotated, flipped, and flopped, or even converted to grayscale (by dropping the chrominance channel). While unwanted information is destroyed, the quality of the remaining portion is unchanged.
Some other transforms are possible to some extent, such as joining images with the same encoding (composing side by side, as on a grid) or pasting images such as logos onto existing images (both via Jpegjoin), or scaling.[7]
Some changes can be made to the compression without re-encoding:
- Optimizing the compression (to reduce size without change to the decoded image)
- Converting between progressive and non-progressive encoding.
The freeware Windows-only IrfanView has some lossless JPEG operations in its JPG_TRANSFORM
plugin.
Metadata
Metadata, such as
Downsampling/compressed representation scalability
One may wish to
Another approach is to encode the original signal at several different bitrates, and then either choose which to use (as when streaming over the internet – as in
Methods
Graphics
Image
- Discrete cosine transform (DCT)
- JPEG[8]
- WebP (high-density lossless or lossy compression of RGB and RGBA images)
- High Efficiency Image Format(HEIF)
- Better Portable Graphics (BPG) (lossless or lossy compression)
- high-dynamic range, wide gamutpixel formats (lossless or lossy compression)
- Wavelet compression
- Cartesian Perceptual Compression, also known as CPC
- Fractal compression
- JBIG2 (lossless or lossy compression)
- 3D computer graphics hardware
3D computer graphics
Video
- Discrete cosine transform (DCT)
- H.261[8]
- Motion JPEG[8]
- MPEG-1 Part 2[9]
- MPEG-2 Part 2 (H.262)[9]
- MPEG-4 Part 2 (H.263)[8]
- Advanced Video Coding (AVC / H.264 / MPEG-4 AVC)[8] (may also be lossless, even in certain video sections)
- High Efficiency Video Coding (HEVC / H.265)[8]
- Ogg Theora (noted for its lack of patent restrictions)
- VC-1
- Wavelet compression
- Motion JPEG 2000
- Dirac
- Sorenson video codec
Audio
General
- Modified discrete cosine transform (MDCT)
- Dolby Digital (AC-3)
- Adaptive Transform Acoustic Coding(ATRAC)
- MPEG Layer III (MP3)[10]
- MP4 Audio)[11]
- Vorbis
- Windows Media Audio (WMA) (Standard and Pro profiles are lossy. WMA Lossless is also available.)
- LDAC[12][13]
- Opus(Notable for lack of patent restrictions, low delay, and high quality speech and general audio.)
- Adaptive differential pulse-code modulation (ADPCM)
- MPEG-1 Audio Layer II (MP2)
- Musepack (based on Musicam)
- aptX/ aptX-HD[14]
Speech
- Linear predictive coding (LPC)
- Adaptive predictive coding (APC)
- Code-excited linear prediction (CELP)
- Algebraic code-excited linear prediction (ACELP)
- Relaxed code-excited linear prediction (RCELP)
- Low-delay CELP(LD-CELP)
- Adaptive Multi-Rate (used in GSM and 3GPP)
- Codec2(noted for its lack of patent restrictions)
- Speex (noted for its lack of patent restrictions)
- Modified discrete cosine transform (MDCT)
- AAC-LD
- Constrained Energy Lapped Transform(CELT)
- Opus(mostly for real-time applications)
Other data
Researchers have performed lossy compression on text by either using a thesaurus to substitute short words for long ones, or generative text techniques,[15] although these sometimes fall into the related category of lossy data conversion.
Lowering resolution
A general kind of lossy compression is to lower the resolution of an image, as in
See also
- Compression artifact
- Data compression
- Image scaling
- Lenna
- List of codecs
- Lossless compression
- Rate–distortion theory
- Seam carving
- Transcoding
Notes
- PMID 22347940.
- Encyclopedia Britannica. Retrieved 13 August 2019.
- S2CID 149806273
- ^ "T.81 – DIGITAL COMPRESSION AND CODING OF CONTINUOUS-TONE STILL IMAGES – REQUIREMENTS AND GUIDELINES" (PDF). CCITT. September 1992. Retrieved 12 July 2019.
- ^ “Although one main goal of digital audio perceptual coders is data reduction, this is not a necessary characteristic. As we shall see, perceptual coding can be used to improve the representation of digital audio through advanced bit allocation.” Masking and Perceptual Coding, Victor Lombardi, noisebetweenstations.com
- ^ Svetlik, Joe (December 5, 2016). "MP3s make you less happy, study says". What Hi Fi?. Retrieved December 17, 2018.
- ^ "New jpegtran features". sylvana.net. Retrieved 2019-09-20.
- ^ a b c d e f Stanković, Radomir S.; Astola, Jaakko T. (2012). "Reminiscences of the Early Work in DCT: Interview with K.R. Rao" (PDF). Reprints from the Early Days of Information Sciences. 60. Retrieved 13 October 2019.
- ^ a b K. R. Rao and J. J. Hwang, Techniques and Standards for Image, Video, and Audio Coding, Prentice Hall, 1996; JPEG: Chapter 8; H.261: Chapter 9; MPEG-1: Chapter 10; MPEG-2: Chapter 11.
- ^ Guckert, John (Spring 2012). "The Use of FFT and MDCT in MP3 Audio Compression" (PDF). University of Utah. Retrieved 14 July 2019.
- ^ Brandenburg, Karlheinz (1999). "MP3 and AAC Explained" (PDF). Archived (PDF) from the original on 2017-02-13.
- ^ Darko, John H. (2017-03-29). "The inconvenient truth about Bluetooth audio". DAR__KO. Archived from the original on 2018-01-14. Retrieved 2018-01-13.
- ^ Ford, Jez (2015-08-24). "What is Sony LDAC, and how does it do it?". AVHub. Retrieved 2018-01-13.
- ^ Ford, Jez (2016-11-22). "aptX HD - lossless or lossy?". AVHub. Retrieved 2018-01-13.
- ^ I. H. WITTEN; et al. "Semantic and Generative Models for Lossy Text Compression" (PDF). The Computer Journal. Retrieved 2007-10-13.
External links
- Lossy audio formats, comparing the speed and compression strength of five lossy audio formats.
- Data compression basics, including chapters on lossy compression of images, audio and video.
- Lossy PNG image compression at the Wayback Machine (archived 2005-10-03)
- Using lossy GIF/PNG compression for the web (article)
- JPG for Archiving, comparing the suitability of JPG and lossless compression for image archives
- JPG Image Compression, Jpg, Png compressor tool