Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, it's easier to read in a hex editor and seemed like the right thing to do for a "wire format".

The only places where it matters is the header's width/height and order of RGB(A) data. Storing RGBA as ABGR is not a great choice, imho. If you want to be endian independent, you have to read one byte at a time anyway (or swap).



ARGB would be nice if you want to integrate with Cairo.


Storing rgba as abgr is a terrible choice, but are you sure they're actually doing that?


Sorry, I see how my previous comment was misleading. To clarify: No, QOI is not doing that. QOI stores RGBA as R,G,B,A because it is big endian.

Little endian would imply that RGBA is stored as A,B,G,R. Which was my argument against using LE for a file format.


I don't believe it would imply that, because those are independent elements. RGBA would still be stored as R, G, B, A unless you're considering each pixel as a single 32-bit integer. A C structure for the colors would even live in memory in the order you expect. Just like a string is still stored byte-by-byte even in little-endian contexts.

LE vs BE would only affect multi-byte integers and floats, not arrays or structures of single-byte elements.


why are channels interleaved at all if speed of decompression was the goal?


Because almost everywhere you would use data will expect it as interleaved. Separating the channels would require a second pass to re-interleave the data.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: