Contextual Reconstructive Entropy (TECR)
Pixu’s compression model is grounded in Contextual Reconstructive Entropy — a practical extension of classical information theory for images on the web.
It does not claim to break Shannon’s theorem. It changes the problem we optimize for: minimize what you ship, given shared context and an acceptable reconstruction error.
Why Shannon is not the whole story
Shannon’s source coding theorem states that, under a fixed probabilistic model of a source, you cannot losslessly compress every message below its average entropy
That bound holds when:
- compressor and decompressor share no extra knowledge beyond the codec;
- the goal is exact recovery (
); - “information” means statistical redundancy only.
Real image delivery violates those assumptions all the time:
| Classical premise | Web / Pixu reality |
|---|---|
| Exact bit recovery | Perceptual equivalence is enough |
| No shared prior | Codec + analysis + domain heuristics act as shared |
| Symbol statistics only | Structure, edges, saturation, content class matter |
| Cost = bitstream size | Cost = file + model + context + allowed error |
Core idea
The minimum size needed to represent an object depends not only on the data itself, but on the shared knowledge and reconstruction capacity of the receiver.
We write the shortest description length of
Total representation cost
| Term | Meaning in Pixu |
|---|---|
| Bytes in the output file (WebP/JPEG from the PIXU path, or other) | |
| Codec + Pixu reconstructive pipeline (WebP/JPEG proxy, adaptive encoder) | |
| Content analysis: photo vs graphic, complexity, edges, chroma | |
| Allowed perceptual distortion |
A method can produce files much smaller than entropy estimated on pixels alone. The missing bits did not vanish — they live in
Levels of TECR in Pixu
| Level | Name | What Pixu does |
|---|---|---|
| 0 | Signal context | Block variance, saturation, chroma-aware quality |
| 1 | Content context | Smart Quality: photo / graphic / text priors |
| 2 | Format context | PIXU path: adaptive encode + perceptual |
| 3 (roadmap) | Semantic / generative | Shared generative |
Levels 0–2 ship today. Level 3 is the research horizon (versioned models, explicit
What “best compression” means here
Pixu optimizes for:
where
That is why PIXU routinely beats naive JPEG/WebP at the same visual budget: it spends bits where the eye cares and borrows structure from
Honest comparison to Shannon
| Claim | Status |
|---|---|
| “We beat Shannon losslessly on arbitrary data” | False — impossible under classical premises |
| “We beat naive codecs under perceptual | True — this is Pixu’s product claim |
| “Future generative codecs rewrite | Research — TECR level 3 |
Mapping to the API
import { compress } from '@pantanal/pixu'
const result = await compress(file, {
format: 'image/pixu', // prefer reconstructive PIXU path (M)
enableSmartQuality: true, // build C from image content
quality: 0.85, // ε budget when you fix it explicitly
stripMetadata: true, // drop context the receiver does not need
})| Option | TECR role |
|---|---|
format: 'image/pixu' | Selects reconstructive model |
enableSmartQuality | Estimates content context |
quality / adaptive quality | Sets |
| Dual-pass / target size | Search over |
See also:
- PIXU Format — format that implements TECR levels 0–2
- Smart Quality — content context
- Image Analysis — inspecting
explicitly
Scientific checklist (for contributors)
To deepen TECR as a theory — not marketing:
- Define information, context, reconstruction, and error rigorously
- State theorems / limits for
- Prove or bound propositions formally
- Publish reproducible experiments (bitrate vs perceptual metrics)
- Always report
, never only - Prefer predictions classical codecs do not explain well
The valuable discovery is not “Shannon was wrong.” It is a new practical limit for contextual and reconstructive image compression — the foundation of Pixu.
