gitwtfhub

wtf is miniwtpc?

lieff/miniwtpc — explained in plain English

Analysis updated 2026-05-18

6CAudience · developerComplexity · 3/5Setup · easy

TL;DR

A tiny single-header C image codec built for very small thumbnails and previews, from 200 bytes up to 36 kilobytes.

Mindmap

mindmap
  root((miniwtpc))
    What it does
      Tiny thumbnail codec
      200B to 36KB range
      Single header C
    Tech stack
      C language
      SIMD intrinsics
      Huffman and EBCOT
    Use cases
      Packet sized thumbnails
      Target size encoding
      Codec benchmarking
    Audience
      C developers
    Notes
      Faster than JPEG XL
      Tuned for small images

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Generate a tiny thumbnail image that fits inside a single network packet.

REASON 2

Encode an image to hit a specific target file size instead of a quality level.

REASON 3

Compare image compression quality against JPEG, JPEG 2000, and JPEG XL at small sizes.

REASON 4

Drop a single header codec into a C project without adding a build dependency.

What's in the stack?

CSIMD

How it stacks up

lieff/miniwtpcffmpegkit-maintained/ffmpeggkaragioul/openjkdf2-modern
Stars666
LanguageCCC
Setup difficultyeasyeasymoderate
Complexity3/52/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 30min

Single header C library, SIMD intrinsics are used by default and can be disabled with a build flag.

Wtf does this do

miniwtpc, short for Wavelet Thumbnail and Preview Codec, is a small image compression format built for producing tiny thumbnails and preview images. It is written as a single header C library, similar in style to the popular stb_image libraries, so it can be dropped into a project without a build system. The format targets extremely small file sizes, from as little as 200 bytes up to about 36 kilobytes, at resolutions around 256 by 256 pixels. The main use case is generating a thumbnail small enough to fit inside a single network packet, so a user sees something on screen while a larger, higher quality preview is still downloading. The codec offers two encoding modes: a faster Huffman based mode, and a slower but more efficient mode called EBCOT-lite, which is a simplified version of a technique used in JPEG 2000. The library's C API lets you encode raw RGB or RGBA pixel data either to a target quality level or to a specific target file size, in which case it automatically searches for the quality setting that gets closest to that size. It also supports an optional chroma subsampling mode that reduces color detail slightly to save more bytes. The README includes a detailed benchmark comparing miniwtpc against JPEG, JPEG 2000, and JPEG XL at many different target file sizes, using both a numeric quality score and a visual similarity score. According to these results, miniwtpc consistently produces sharper looking images than the other formats at very small file sizes, and it also encodes and decodes faster in most cases. The README notes this test used a small dataset of about 3000 images, and that its own quantization settings are tuned specifically for these very low bitrates. The full README is longer than what was shown.

Yoink these prompts

Prompt 1
Help me call wtpc_encode_mem to compress an RGB image to a target byte size.
Prompt 2
Explain the difference between the Huffman and EBCOT-lite encoding modes.
Prompt 3
Walk me through enabling 4:2:0 chroma subsampling to reduce file size further.
Prompt 4
Show me how to decode a WTPC bitstream back into raw pixel data.

Frequently asked questions

wtf is miniwtpc?

A tiny single-header C image codec built for very small thumbnails and previews, from 200 bytes up to 36 kilobytes.

What language is miniwtpc written in?

Mainly C. The stack also includes C, SIMD.

How hard is miniwtpc to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is miniwtpc for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.