// readme

Babe β€” Bi-Level Adaptive Block Encoding

Babe is an experimental dual‑tone block-based image codec designed for extremely lightweight compression with visually smooth output. The encoder uses byte-symbol range coding with local frequency tables, parallel processing and reusable buffers. Qualities 0–99 are lossy; quality 100 preserves opaque 8-bit RGB pixels exactly.

Features

  • Two‑tone block encoding with adaptive subdivision
  • Quality-dependent quantization of YCbCr block levels
  • Delta-coded block levels
  • Byte-symbol range coding with parallel stream compression and decompression
  • Lossy qualities 0–99 and lossless 8-bit RGB at quality 100
  • Minimal API: Encode(image, quality, bw) and Decode(data, postfilter)

How It Works

At a high level, Babe is a block-based codec with a dual-tone model per block and three independent color streams.

  1. Color space and input
    • At qualities 0–99 the source image is converted to a YUV-like space. At quality 100, the channels are instead G, B-G, and R-G, using reversible byte arithmetic.
    • Luma and chroma are processed with different sensitivity so that most detail is preserved in brightness while color is…