Lossless and Lossy Format Guarantees
A lossless format reconstructs its declared input exactly. A lossy format can change selected information according to its design.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace two purposes
Archiving source text can require exact bytes. A smaller preview image may tolerate reduced intensity detail. See meaningful round trips for deciding what equality concerns.
Choose the right quality check
A lossless check compares reconstruction exactly. A lossy check can compare distortion and byte size under a chosen metric, including possible artifacts. Numerical error measures provide simple comparison tools.[1][2]
Choose the property that must survive a round trip
A lossless backup decoder must recover every original byte. A lossy audio or image representation can instead preserve values within an agreed quality criterion. The test needs a reference and a measure connected to the application. See exact round trips.
Lossless test: decoded bytes equal original bytes
Lossy test: compare against a specified fidelity measure, such as maximum error
Preserve structural requirements in both
Keep a metadata contract alongside the signal contract
A format can reconstruct sample values while discarding optional metadata. Decide whether that is allowed. Test an empty sample, ordinary data and a boundary-sensitive case.