DDS BC5 compression/decompression has Red and Blue swapped.
GIMP version: 2.10.22
Operating System: Tested only on Windows.
Package: Installer from gimp.org
Description of the bug
Exporting an image from GIMP as DDS with BC5 compression with investigation from external programs (such as NVIDIA Texture Tools's nvcompress) shows that GIMP writes the output with Red and Green channels swapped.
The opposite is also true; using external programs (such as NVIDIA Texture Tools's nvcompress) to create a DDS with BC5 compression and viewing it in GIMP shows the image with Red and Green channels swapped.
Although a bit unrelated(?), the issue also exists in DDS Converter.
Original PNG:
Converted files:
BC5_gimp.dds BC5_nvcompress.dds
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Export image from GIMP as DDS with BC5 compression.
- Use a reliable external program to convert the DDS to an RGBA format (such as NVIDIA Texture Tools's nvcompress) and view it.
OR:
- Use a reliable external program to create a DDS with BC5 compression (such as NVIDIA Texture Tools's nvcompress).
- Open the output DDS in GIMP and compare with original image.
Expected result: Correct ordering of Red and Green channels.
Actual result: Reversed order of Red and Green channels.
PS: Not a bug, but could the Blue channel be set to 0 instead of 1 (255) at decompression? It appears to be more common with external programs as well, especially when the texture is used as a normal map.