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
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • qoi

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

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

    Indeed.

    > 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:

    https://github.com/pedrocr/rawloader/blob/a59bb78d156277781a...

    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.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • 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

    Discontinued 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

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
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