forja — same format in, same format out — smaller, and the loss is not worth noticing
2026·08 · active · python · docker
the itch
every image compressor ships a quality slider — which is the tool asking you the one question it exists to answer. and the tool that owns this space answers it from a server: your photos travel, and 76 of 149 of them come back below its own quality bar. forja is the other shape: no knobs, nothing leaves your machine, and the answer is measured instead of asked.
a previous attempt at this problem spent almost all of its effort fitting constants that predicted a competitor's byte count. its own notes record that the fits broke whenever anything upstream changed — and that widening the set of encoders paid every single time. so forja keeps no model of anybody: the effort goes into real encoders — mozjpeg, cjpegli, libwebp, aom, oxipng, pngquant, compiled from pinned source — and into measuring what they produce.
one decision, made once
the whole policy is a floor: nothing ships below 75 on SSIMULACRA 2, judged through a colour-managed pipeline. a floor, not an average — it is a promise about every image, where the rival's average hides its worst. the metric names its own anchors (70 high quality, 90 indistinguishable), so the scale is not forja's to invent.
the scoreboard was not allowed to choose the number. wins against the rival peak at exactly 74 — because that is where the rival's own quality histogram is densest, so tuning there would be fitting the competitor, the one forbidden move. 75 is picked on the two axes no rival appears in: the anchors are averages, so a delivered floor belongs above the anchor it honours; and the corpus prices a point at ~4.4% of bytes right where that anchor sits.
the search is deliberately not clever
every codec walks every rung of its ladder, in order, and the cheapest encoding still clearing the floor wins. the bisection it replaced assumed quality rises with the knob — 19 of 28 measured png/posterise ladders walk backwards, by as much as 42 points. what keeps brute force affordable is the lead's byte count: a rung that encodes larger than the current lead cannot win however good it is, so the walk stops and everything above it goes unmade. skipping an encode is worth ~28× skipping a measurement.
the input is a candidate like any other — it kept every pixel, so it clears the floor by definition, and nothing larger than it can ever be emitted. no special case produces the passthrough; the search does. a final bisection then lands the winner on the floor instead of the rung above it: −4.7% of shipped bytes for +6.7% probes, measured.
silent plausible output
every bug this project ever had looked fine: nothing crashed, every number was plausible. cached intermediates keyed by filename once made three different images measure identical to three decimals. so the doctrine hardened — a claim is a number, the command that produced it, and the images it was measured on; a number that cannot be replayed does not exist. one session ran 389 cache-reproduction controls before believing anything new: 389 reproduced.
the receipt, under that doctrine: 149 images, tinify's output and forja's judged by the same colour-managed metric. forja ships the corpus at 28.1% of its bytes against their 30.2%, at a median quality of 75.3 against their 74.6, with 0 images below the floor where they leave 76. at matched quality, forja's files are 87.7% of tinify's bytes. the screenshots in forja's own readme shipped through forja — 158 KB of PNG on the page at 6.
facts
status: active · v0.1.0
contract: compress(bytes) → bytes · never larger · never below the floor
floor: SSIMULACRA 2 ≥ 75 — every image, not an average
corpus: 149 images → 28.1% of the bytes · 0 below the floor
vs tinify: 87.7% of its bytes at matched quality · they leave 76 below
encoders: mozjpeg · cjpegli · libwebp · aom · oxipng · pngquant
doors: web · http · mcp · cli — local, docker, opt-in
license: MIT
links
github
← anfreire.dev · the interactive version needs javascript