Data compression techniques can be divided into lossless and lossy methods. Lossless compression preserves the integrity of the data by removing redundant data in compression and adding it back during decompression so that the original and reconstructed data are exactly the same. Lossy compression throws away perceptually insignificant information and cannot recover all bits, but this is acceptable for applications like video where small differences do not impact quality. Compression performance is measured by the compression ratio, bits per sample, and distortion between original and reconstructed data. Compression involves modeling data patterns and encoding the residual differences between the data and model.