Error Code Modeler - Lossless compression for CD image files
ECM reduces the size of CD image files (BIN, CDI, NRG, CCD, and other raw sector formats) by eliminating redundant Error Correction/Detection Codes (ECC/EDC) from each sector.
The encoder automatically detects sector types and strips predictable data. The decoder regenerates every sector exactly as it was stored: full 2352-byte raw sectors, or 2336-byte Mode 2 sectors for images that never had sync and header bytes. Compression is completely lossless, typically shrinking game discs by 10-15%.
Note: "Cooked" ISO files (2048 bytes/sector) contain no ECC/EDC data and will see no size reduction.
ecm game.bin # game.bin -> game.bin.ecm
unecm game.bin.ecm # game.bin.ecm -> game.binThe documentation is organized by what you need, following Diátaxis:
Tutorials — learning by doing
How-to guides — steps for a specific task
- Install ECM
- Compress CD images
- Restore CD images — including CUE sheets
- Stream images through pipes
- Decode archives from old ECM versions
Reference — precise, complete information
Explanation — background and design
- Lossless - Bit-perfect roundtrip compression/decompression
- Automatic detection - Identifies Mode 1 and Mode 2 Form 1/2 sectors at any byte offset, including MODE2/2336 images and raw dumps with subchannel data
- Streaming support - Works with stdin/stdout for pipeline integration
- CUE generation - Optional CUE sheet creation on decode
- Cross-platform - Linux, macOS, Windows
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Ensure tests pass (
meson test -C build, orjust test) - Ensure code is formatted (
just fmt) - Submit a pull request
Build requirements and commands are in Install ECM.
This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.
- Aleksandr Pavlov ckidoz@gmail.com
See AUTHORS.md for full attribution.