phoboslab / qoi

The “Quite OK Image Format” for fast, lossless image compression
MIT License
6.83k stars 328 forks source link

Does QOI support grayscale? #293

Open dmikushin opened 6 months ago

dmikushin commented 6 months ago

Hi, I wonder if the QOI format also covers grayscale? As I understood it is designed mainly for 3 and 4 channels.

phoboslab commented 6 months ago

Support: yes, good at it: no. Of course you can encode grayscale images with qoi, but it will always use 3 channels for it. The resulting file size will be closer to uncompressed than PNG.

A "qoi-like" file format focusing on 1 channel sounds like a fun experiment though. Could probably get good results with storing small chunks as 4bit nibbles.

May I ask: what's your use-case?

dmikushin commented 6 months ago

Hi @phoboslab , thanks ! My usecase is 5 GBytes of grayscale images from a high-speed industrial camera.