Why another image codec?
JPEG, WebP, AVIF, and JPEG XL share one architectural choice: one basis
representation, applied uniformly to every pixel of every image. JPEG
transforms 8×8 blocks of every image with DCT. AVIF uses a stack of
related linear transforms. It's mathematically clean and engineering-
efficient, and it's why these codecs are deployed on every device.
But it means that on content far from natural-photo statistics, the
codec is doing the wrong thing. A 256-color pixel-art icon compressed
with JPEG produces ringing on every edge. A page of vector diagrams
compressed with WebP-lossless rounds the strokes into noise patterns. A
pure smooth gradient in PNG occupies thousands of bytes for what is
essentially a single bicubic patch's worth of information.
The right answer for each of those is well-known: palette codecs for
pixel art, vector formats for diagrams, smooth-function approximations
for gradients. The problem is that real images aren't one of
those things — they're a mix, often within the same image. A
screenshot has UI chrome (palette), text (palette + edges), photographs
(DCT), and gradient backgrounds (smooth). Using one codec for the whole
thing leaves a lot on the table.
Weft is what happens if you say: what if the codec picked the
right representation per tile?