Brytalearn.How things workFind something
Back to the experimentTHE EVIDENCE BEHIND THE EXPERIENCE

Can a picture take less space without losing a pixel?: sources & model

Tell a decoder what to do, paint a tiny picture, make a real PNG and count every byte. Compare reversible prediction with discarded color detail and actual JPEG evidence.

Scientific review · independent subject review pending

The source and model records are available for inspection. No external scientific reviewer has signed off yet.

png-fixed-instructions-1 · content 1 · setup format 1

What supports the explanation?

PNG filtering and file structure

Normative RGB sample layout, filters, chunks, CRC and zlib use. The workshop uses a specified subset, not all PNG features or a prescribed optimal encoder.

W3C · PNG Third Edition

Actual literal/length/distance codes

Sections 3.1 and 3.2 define bit order, overlapping copies, fixed codes and length/distance limits. Search heuristics are separately authored.

RFC 1951 · DEFLATE

The zlib wrapper and checksum

Header and Adler-32 surround raw DEFLATE. The selected 78 01 header is not a promise of another library’s exact compression-level behavior.

RFC 1950 · zlib

JPEG processes and coefficient tables

Common DCT-based processes and the separately defined predictive lossless process. Published standard figures are not reused as licensed artwork.

ITU-T T.81 · original standard

Exact quality-to-table implementation

The pinned encoder’s quality scaling. Reference files use Pillow 12.1.1, libjpeg-turbo 3.1.3, 4:4:4, optimize false and progressive false.

libjpeg-turbo 3.1.3 · source code

Independent browser decompression

DecompressionStream with deflate means zlib-wrapped DEFLATE. This is an independent available browser operation, not a promise of our encoder’s choices.

WHATWG · Compression Standard

Actual public-domain source image

Vincent van Gogh, Wheat Field with Cypresses, 1889, accession 1993.132. Purchase, The Annenberg Foundation Gift, 1993. Public-domain image, CC0 Open Access; exact preparation and hashes are preserved.

The Metropolitan Museum of Art · object 436535

Museum image reuse

CC0 policy for public-domain collection images. Artist, museum and preparation credits are retained; no endorsement is implied.

The Met · Open Access policy

What this model assumes

  1. The PNG encoder is a transparent teaching subset, not a general optimizer or arbitrary-file decoder.
  2. No dynamic or stored DEFLATE blocks, lazy match selection or advanced optimization are implemented.
  3. The actual museum RGB baseline is fixed after resizing and color preparation; that preparation is not lossless relative to the original source JPEG.
  4. Color rounding is separate from PNG prediction and separate from JPEG coefficient quantization.
  5. Decoded equality is relative to the encoder input. Earlier metadata, resolution or color distinctions may already be absent.
  6. A heuristic is allowed to lose; smaller residual scores do not prove a smaller whole file.
  7. A hash, checksum, compressed stream and encrypted message serve different purposes.
  8. Nearest-neighbor magnification shows the existing pixel grid; it does not create compression damage.
  9. JPEG error metrics use the pinned research decoder; browser reconstruction can differ slightly.
  10. Quality is an encoder convention, not a percentage of retained pixels or human satisfaction.
  11. The editor keeps an original for Restore. The PNG does not secretly contain that original.
  12. No personal image upload, private filename or content hash is sent to analytics.
  13. The narrow PNG contract: This encoder produces RGB color type 2, eight bits per channel, no alpha, palette, interlace or animation. Chunks are IHDR, sRGB, one IDAT and IEND. Its decoder deliberately accepts this lesson profile, not arbitrary user files.
  14. The bounded match search: At each position, an authored greedy search examines up to 64 recent positions with the same next three bytes, newest first. It takes the longest found match, keeping the nearest on ties. Valid lengths are 3–258 bytes; distances are 1–32,768 and cannot exceed available output.
  15. Why overlapping copies work: For length greater than distance, the decoder repeatedly reads output[current length − distance]. A one-time slice of the initial history would be wrong: later copied bytes may refer to bytes created earlier in this same instruction.
  16. Bits have two ordering rules: Non-Huffman fields and extra bits enter bytes least-significant-bit first. Huffman codes are emitted most-significant-bit first. A single final fixed block begins with three header bits, ends with symbol 256, and pads its final partial byte.
  17. Prediction has no automatic size win: Each channel residual remains a byte, and each row gains one filter tag. The local suggestion score sums signed residual magnitudes. Later matches and bit costs can contradict that score: on this exact museum input, all-Sub makes a 55,896-byte PNG while the heuristic makes 55,999.
  18. Relative losslessness: Decoding exactly reproduces the supplied RGB samples, not necessarily an earlier JPEG file, camera sensor data or all source metadata. A resized, color-converted or rounded input may already differ from an older reference before lossless coding begins.
  19. Quantization and numeric error: For L levels, each channel maps to floor((x × (L − 1) + 127) / 255) × 255 / (L − 1). Here L is 256, 16 or 4. A pixel counts as changed if any channel differs; mean squared error averages squared differences over stored RGB channels. It is not a measure of beauty or scientific acceptability.
  20. What common JPEG changes: The evidence uses a common DCT-based JPEG process with 8 × 8 component blocks, coefficient quantization and entropy coding. Its fixed 4:4:4 setting removes chroma subsampling as a changed variable. The quantization grid indexes spatial-frequency coefficients, not image pixels.
  21. Quality 100 is not the lossless mode: The selected libjpeg-turbo version sets quantization entries to one at Q100. Its actual decoded file still differs from the input because that is not the same as reversing every conversion, transform and rounding operation. T.81 separately defines a predictive lossless JPEG process.
  22. Not every input can shrink: There are eight distinct three-bit strings but only seven strings shorter than three bits, including the empty string. A reversible scheme cannot give every input a unique shorter representation. This limited encoder can expand inputs; it does not switch to stored blocks to bound expansion.

What has been checked

Analytical reference cases, conservation or transition invariants, finite drawing commands, bounded setup parsing, discovery and route integrity are checked automatically. These checks do not establish anatomical fidelity, learner outcomes or browser/device compatibility. Independent subject review, learner trials, comprehensive accessibility review and browser video encoding checks remain pending.

Each source supports the associated claim. Sources do not certify this implementation or its visuals.

About the cover illustration

Actual decoder output from the lesson’s real fixed-code DEFLATE experiment. Original byte-reconstruction artwork; no private image or measured hardware is depicted.

Our review process