2 ms·
JPEG compression works in two phases: 1. Discrete Cosine Transform, discarding insignificant information. 2. Compression of bitstream. Step 1 is lossy in pra
by mkl 7y ago
JPEG compression works in two phases:
1. Discrete Cosine Transform, discarding insignificant information.
2. Compression of bitstream.
Step 1 is lossy in practice because it throws away things that seem insignificant. The "quality" control determines what counts as insignificant. Step 2 is lossless, and just tries to make the data coming out of Step 1 take up as little space as possible.
A repacker redoes Step 2 better: it makes the file smaller without reducing the quality, by changing how the data is compressed, not changing which parts are kept.