So add a high-dynamic range support by using the idea from radiance image format. Store the exponent in the alpha channel, and the floating point significands into the r, g and b channels. Naturally the HDR image would be therefore just RGB. The HDR images are useful in 3D graphics, especially with IBL (image based lighting.)
Technically nothing has to be changed in QOI format itself, except maybe add some sort of implication to the header that the image is HDR type, like QOI_FORMAT_RGBE (E stand for exponent, and implies high dynamic range). Only thing that is needed is RGB32F -> RGBE8 preprocessing and RGBE8 -> RGB32F post processing steps after the data is stored / loaded. I'm not sure how this sort of data storing will effect the compression rates, but there's only one way to find out.
So add a high-dynamic range support by using the idea from radiance image format. Store the exponent in the alpha channel, and the floating point significands into the r, g and b channels. Naturally the HDR image would be therefore just RGB. The HDR images are useful in 3D graphics, especially with IBL (image based lighting.)
Technically nothing has to be changed in QOI format itself, except maybe add some sort of implication to the header that the image is HDR type, like QOI_FORMAT_RGBE (E stand for exponent, and implies high dynamic range). Only thing that is needed is RGB32F -> RGBE8 preprocessing and RGBE8 -> RGB32F post processing steps after the data is stored / loaded. I'm not sure how this sort of data storing will effect the compression rates, but there's only one way to find out.
Pseudo code for RGB32F to RGBE8 processing:
And pseudocode for the same other way around:
That's how radiance / .hdr images basically do the conversion.