gitmyhub

qoi

C ★ 7.5k updated 23d ago

The “Quite OK Image Format” for fast, lossless image compression

QOI is a fast, lossless image format implemented as a single C/C++ header file, compression similar to PNG but substantially faster to encode and decode, with no extra build steps to add it.

CC++setup: easycomplexity 2/5

QOI, short for "Quite OK Image Format," is a lossless image format designed to be fast at both encoding and decoding. The entire implementation is a single C/C++ header file under the MIT license, so adding it to a project means dropping in one file with no extra build steps.

The format sits in a practical middle ground between raw speed and compression size. Its compression output is roughly comparable to PNG, though typically not as tight as the most optimized PNG libraries. Where QOI stands out is throughput: encoding and decoding are substantially faster than PNG, which matters when reading or writing many images quickly. Because the format specification itself is extremely simple, it has been ported to dozens of programming languages, including Python, Rust, Go, Java, Zig, Swift, Elixir, OCaml, and many others.

The format is finalized and intentionally has no version number in file headers. A working QOI implementation today will be compatible with all QOI files in the future. The project does not plan to extend the format or accept pull requests that change it.

This reference implementation loads an entire image into memory before processing, and is capped at 400 million pixels. It is not a streaming decoder. For images beyond that size, the README points to third-party implementations. The recommended file extension is .qoi and the recommended MIME type is image/qoi.

The ecosystem around QOI has grown considerably. There are plugins for Windows Explorer, macOS Finder, GNOME, GIMP, Paint.NET, Godot, Unity, and Unreal Engine 5. Tools exist for viewing QOI images in terminals, desktop applications, and web browsers, and Microsoft PowerToys added QOI preview and thumbnail support for Windows Explorer. Format-level benchmarks comparing QOI, PNG, and other options are published at qoiformat.org.

Where it fits