Python: Import X8R8G8B8 DDS texture as A8R8G8B8?

I'm in the dead-end of some things done wrong before they were given to me.

Basically, I have many, many DDS textures here stored in the X8R8G8B8 pixel format. However, the X channel is actually holding alpha information and thus the whole texture should've been stored as A8R8G8B8.

When importing such a DDS file into Blender, it correctly ignores the X channel like every sane tool should do, but I want it to load it as the A channel.

Is there any way to customize the image loading step and configure how Blender maps the channels? I cannot tell the people who converted those buggy DDS textures to fix them, sadly.

Right now, I simply use:

texture.image = bpy.data.images.load("bugged.dds")


Can this "load" be configured? Or do I have to write the whole DDS support myself again to make Blender the victim which has to fix these pixel format shenanigans? (I'd probably change the DDS header to give the X channel a meaning then. The alpha bit mask is not set and the flags do not include alpha support.)

with BinaryWriter(open(image_file_name, "r+b")) as writer:

(BinaryWriter is a custom class. Simply pack an unsigned integer at position 0x68 which masks the alpha bits.)