Skip to content

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 H(X).

That bound holds when:

  • compressor and decompressor share no extra knowledge beyond the codec;
  • the goal is exact recovery (x′=x);
  • “information” means statistical redundancy only.

Real image delivery violates those assumptions all the time:

Classical premiseWeb / Pixu reality
Exact bit recoveryPerceptual equivalence is enough
No shared priorCodec + analysis + domain heuristics act as shared M
Symbol statistics onlyStructure, edges, saturation, content class matter
Cost = bitstream sizeCost = 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 x under shared model M, context C, and error budget ε as:

L(x∣M,C,ε)

Total representation cost ​

Ctotal=Cfile+Cmodel+Ccontext+Cerror
TermMeaning in Pixu
CfileBytes in the output file (WebP/JPEG from the PIXU path, or other)
CmodelCodec + Pixu reconstructive pipeline (WebP/JPEG proxy, adaptive encoder)
CcontextContent analysis: photo vs graphic, complexity, edges, chroma
CerrorAllowed perceptual distortion ε (quality / smart quality)

A method can produce files much smaller than entropy estimated on pixels alone. The missing bits did not vanish — they live in M and C, or were spent as ε.

Levels of TECR in Pixu ​

LevelNameWhat Pixu does
0Signal contextBlock variance, saturation, chroma-aware quality
1Content contextSmart Quality: photo / graphic / text priors
2Format contextPIXU path: adaptive encode + perceptual ε as first-class
3 (roadmap)Semantic / generativeShared generative M; store prompts or latents, not all pixels

Levels 0–2 ship today. Level 3 is the research horizon (versioned models, explicit Cmodel accounting).

What “best compression” means here ​

Pixu optimizes for:

minCfiles.t.d(x,x^)≤ε

where d is a perceptual distortion (implicit in quality + content-aware tuning), not bit-exact equality.

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 C and M.

Honest comparison to Shannon ​

ClaimStatus
“We beat Shannon losslessly on arbitrary data”False — impossible under classical premises
“We beat naive codecs under perceptual ε + context”True — this is Pixu’s product claim
“Future generative codecs rewrite L(x∣M,C,ε)”Research — TECR level 3

Mapping to the API ​

typescript
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
})
OptionTECR role
format: 'image/pixu'Selects reconstructive model M
enableSmartQualityEstimates content context C
quality / adaptive qualitySets ε
Dual-pass / target sizeSearch over Cfile under ε

See also:

Scientific checklist (for contributors) ​

To deepen TECR as a theory — not marketing:

  1. Define information, context, reconstruction, and error rigorously
  2. State theorems / limits for L(x∣M,C,ε)
  3. Prove or bound propositions formally
  4. Publish reproducible experiments (bitrate vs perceptual metrics)
  5. Always report Ctotal, never only Cfile
  6. 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.

Released under the MIT License.