You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Speaking of Windows (#24)... IIUC the default Windows color order is BGRA (not RGBA) and likewise for Linux (X11) and I think MacOS / iOS too. Can't remember what Android is.
Anway, if we're talking of finalizing the file format (#28), consider QOI producing BGRA, not RGBA. Especially as QOI is about being fast to decode, this would avoid what libpng calls the PNG_TRANSFORM_BGR step.
Transforming BGRA <-> RGBA is cheap, especially with SIMD, but it's not free.
The text was updated successfully, but these errors were encountered:
As far as I can tell RGBA isn't part of the format? Looking at the decoder, I think you could just change unsigned char r, g, b, a; to unsigned char b, g, r, a; in the qoi_rgba_t definition to decode straight to BGRA, without changing the format, and presumably for free.
I'd suggest keeping the (default) color channel order as it is, as it's the same as in stb_image.h, and (more importantly) some older 3D APIs (like WebGL) don't directly support creating textures in BGRA format.
Speaking of Windows (#24)... IIUC the default Windows color order is BGRA (not RGBA) and likewise for Linux (X11) and I think MacOS / iOS too. Can't remember what Android is.
Anway, if we're talking of finalizing the file format (#28), consider QOI producing BGRA, not RGBA. Especially as QOI is about being fast to decode, this would avoid what libpng calls the
PNG_TRANSFORM_BGR
step.Transforming BGRA <-> RGBA is cheap, especially with SIMD, but it's not free.
The text was updated successfully, but these errors were encountered: