Ahammed Rashad

Why We Switched to AVIF

How a format change made Tessact’s library sharper, lighter, and faster without rebuilding the media pipeline.

01 · Look closer

The same frame, encoded twice

Drag across the image, then move into the details. Both files are 1440 × 810. The JPEG is quality 38; the AVIF is quality 42.

Cinematic studio frame encoded as JPEGAVIF · 28 KBJPEG · 58 KB
JPEG58.4 KBbaseline
AVIF28.0 KBsame dimensions
Transfer−52%for this frame
02 · The constraint

A reliable pipeline that became heavy

Tessact already extracted frames with FFmpeg, assembled them with Pillow, and stored the result as PNG. It worked. The problem grew with every preview frame.

The middle frame became the thumbnail. Longer sequences were assembled into PNG sprite sheets for scrubbing. It was predictable, easy to debug, and already integrated with the rest of the media stack.

But PNG made every additional preview expensive. Sprite sheets grew quickly, increased storage and transfer, and made a visual library feel slower than the interface around it. JPEG reduced the bytes, but visible artifacts and the loss of transparency made it the wrong compromise.

03 · Work with the system

FFmpeg could not encode AVIF

Ubuntu 22.04 gave us FFmpeg 4.4.2. Replacing it would solve one codec problem while creating risk across the rest of the stack.

Pulling a newer build from an external PPA would add a dependency we did not control. Static FFmpeg builds were harder to trust and maintain, while a broader system upgrade was already creating conflicts with Python and other packages in the stack.

So we kept FFmpeg 4.4.2 doing what it already did well: capturing frames as PNG. A second, isolated step passed those frames to the libavif CLI and produced the final AVIF thumbnails and sprite sheets. It solved the format problem without rebuilding the media pipeline.

04 · The detail JPEG could not keep

Transparency has to survive both themes

Motion graphics often arrive with an alpha channel. Switch the background and format to see why flattening them into JPEG was not acceptable.

LightDark
JPEG chart preview on dark interface
JPEGFlattened background · 10.0 KB
AVIF chart with transparency on dark interface
AVIFAlpha preserved · 4.9 KB

JPEG carries its flattened background into the interface. AVIF keeps the feathered edge transparent across both themes.

05 · Feel the payload

A sprite sheet becomes a timeline

These 24 frames were sampled across a three-minute video, converted to monochrome, given a fine layer of grain, and arranged into a 6 × 4 sheet. In production, Tessact packs more than 100 frames into a sheet that stays below 500 KB.

Move across to scrub00:00:00
24 monochrome frames with grain3.0 MB PNG102 KB AVIF
06 · The product outcome

Smaller previews change how the library feels

Load the same demo sheet into a thumbnail-led surface. The time is a theoretical transfer at 10 Mbps; decoding and network latency vary.

AVIF≈ 0.08 sraw transfer at 10 Mbps

AVIF was not just a codec swap. It let the redesigned Tessact library stay sharp, preserve alpha, move less data, and feel more immediate— without forcing a risky rebuild of the media pipeline around it.