A from-scratch implementation of JPEG-style image compression in Python.
Image → RGB→Y → Pad → DCT → Quantize → Zigzag → RLE → Huffman → .bin
.bin → Huffman decode → de-zigzag → Dequantize → IDCT → Crop → Image
pip install -r requirements.txt
python encoder.py input.jpg output.bin
python decoder.py output.bin decoded.png
[6B magic][4B header_len][4B padding][JSON codebooks][bitstream]