QOI: Lossless Image Compression in O(n) Time

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • Scout APM - Less time debugging, more time building
  • SonarLint - Clean code begins in your IDE with SonarLint
  • Mergify - Automate your Pull Request with Mergify
  • qoi

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

    > The lookup table is small enough to fit into 8 AVX2 registers


    > so instead of hashing, you could use direct lookup

    However, I don’t think that part gonna work. See the code using that table: https://github.com/phoboslab/qoi/blob/master/qoi.h#L324-L328

    SIMD registers aren’t indexable (at least not on AMD64), the register needs to be known to the compiler.

    Lanes within each register aren’t indexable either. The insert and extract instructions are encoding lane index in the code. There’re workarounds for this one, like abusing vpshufb or vpermd, but with that amount of overhead I doubt SIMD will deliver any profit at all.

  • rawloader

    rust library to extract the raw data and some metadata from digital camera images

    The simplest form is just to pack 10 or 12 bit values. There's all kinds of variations of that:


    There are a few formats that use a curve and less bits. They do become lossy and doing dithering on decompress is useful to avoid banding.

    The Nikon one you mention was only used very early and is decoded by decode_8bit_wtable() in that file. It's just looking up the 8 bit value in the table and then adding some randomness to prevent the banding.

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • Zpng

    Better lossless compression than PNG with a simpler algorithm

    - I feel like the benchmark suite is lacking. For better overview you probably should include libpng results with max compression level and lowest compression level. Lossless modes of AVIF and WEBP would be nice. (also could throw similar project to yours like https://github.com/catid/Zpng) Not saying the benchmark is bad, but IMHO doesn't paint the full picture. From quick test I got significantly better compression on libpng, ofc in expense of time, but you didn't optimize it for speed either. So we have some results, but they are not really representative imho.

  • qoi

    Pure Go encoder/decoder of the QOI image format (by xfmoulet)

  • qoi

    A rust implementation of the “Quite OK Image” format for fast, lossless image compression (by steven-joruk)

    I really like the format, good job. I've been working on a rust implementation: https://github.com/steven-joruk/qoi

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts