The 24-bit color endianness.
In most color models red takes the highest bits followed by green and blue occupies the lowest bits. That is why the 32-bit color is laid out as BGRA in memory on little-endian machines, which are the majority. In all color depths except 24 bits, this does not matter because the graph library uses masks and shifts to access the color values. In 24-bit color rgb24, the order is now fixed as RGB or big-endian in the graph library.
This is contrary to little-endian Windows, which expects BGR for 24-bit color. Googling 24-bit visuals[1] reveals that BGR seems to be preferred by X11 also. Therefore, RGB needs to be converted to BGR almost always, so it seems. Only libPNG prefers RGB but can work with BGR as well.
This is my case to switch to BGR for 24-bit color. Majority of graphic demos do not assume RGB. I know that ftgamma
really needs RGB now and ftsdf
can be less picky about the depth.
[1] The search returns a few xdpyinfo
outputs. Notice the masks and the image byte order.