A lossy compression method is one where compressing data and then decompressing it retrieves data that may well be different from the original, but is close enough to be useful in some way. Lossy compression is most commonly used to compress multimedia data (audio, video, still images), especially in applications such as streaming media and internet telephony. By contrast, lossless compression is required for text and data files, such as bank records, text articles, etc.
Lossy compression formats suffer from generation loss: repeatedly compressing and decompressing the file will cause it to progressively lose quality.
This is in contrast with lossless data compression.
Information-theoretical foundations for lossy data compression are provided by rate-distortion theory. Much like the use of probability in optimal coding theory, rate-distortion theory heavily draws on Bayesian estimation and decision theory in order to model perceptual distortion and even aesthetic judgment.
In some systems the two techniques are combined, with transform codecs being used to compress the error signals generated by the predictive stage.
The advantage of lossy methods over lossless methods is that in some cases a lossy method can produce a much smaller compressed file than any known lossless method, while still meeting the requirements of the application.
Lossy methods are most often used for compressing sound, images or videos. This is because these types of data are intended for human interpretation where the mind can easily "fill in the blanks" or see past very minor errors or inconsistencies – ideally lossy compression is transparent (imperceptible), which can be verified via an ABX test.
An important caveat about lossy compression is that converting (formally, transcoding) or editing lossily compressed files causes digital generation loss from the re-encoding. This can be avoided by only producing lossy files from (lossless) originals, and only editing (copies of) original files, such as images in raw image format instead of JPEG.
jpegtran, and the derived exiftran (which also preserves EXIF information), and Jpegcrop (which provides a Windows interface).These allow one to
JPEGjoin allows one to join different JPEG images (which have the same encoding), without re-encoding. (See also: New jpegtran features)
One can also make some changes to the compression without re-encoding:
There is also the freeware Windows-only IrfanView, which has some lossless JPEG operations in its JPG_TRANSFORM plugin.
split and cat.Gain: Various Replay Gain programs such as MP3gain allow one to modify the gain (overall volume) of MP3 files losslessly.
Some well known designs that have this capability include JPEG 2000 for still images and H.264/MPEG-4 AVC based Scalable Video Coding for video. Actually such schemes have also been standardized for older designs as well, such as JPEG images with progressive encoding, and MPEG-2 and MPEG-4 Part 2 video, although those prior schemes had limited success in terms of adoption into real-world common usage.
Without this capacity, which is often the case in practice, to produce a representation with lower resolution or lower fidelity than a given one, one needs to start with the original source signal and encode, or start with a compressed representation and then decompress and re-encode it (transcoding), thought this latter tends to cause digital generation loss.
On a related point, some audio formats feature a combination of a lossy format and a lossless correction; this allows stripping the correction to easily obtain a lossy file, though whether the lossy portion itself can be further stripped is a separate question. Such formats include MPEG-4 SLS (Scalable to Lossless), WavPack, and OptimFROG DualStream.