Open RunDevelopment opened 2 years ago
Yes, this is since which channel to decode into is ambiguous, so it defaults to alpha when decoding BC4. the BC4decoder has a channel argument in its constructor to tell it which to use. Again, I'll look into how to make this more convenient when using dds.read
Ah, looks like I did account for this: you can pass constructor arguments to decode(). Try dds.read(path).decode(channel=0, write_alpha=True).save(target, format="png")
. I might also make it so that decoders can be passed to decode() instead of always constructing them there
A very common solution is to output grayscale images for single-channel images. This is also what texconv does.
That's a good solution. I'll consider it. In the meantime you can perform that transformation by extracting the alpha channel from the resulting pillow image.
ATI 1 is a single channel format.
When using the code
dds.read(pathlib.Path(path)).decode().save(target, format="png")
to convert an ATI 1 DDS file to PNG, it produces a wrong image. The saved image is of the format RGB = (0,0,0) with the alpha channel containing the channel of the DDS file.