Added support for reading DX10 BC4 DDS images#7603
Added support for reading DX10 BC4 DDS images#7603radarhere merged 4 commits intopython-pillow:mainfrom
Conversation
| DXGI_FORMAT_R8G8B8A8_UNORM = 28 | ||
| DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29 | ||
| DXGI_FORMAT_BC4_TYPELESS = 79 | ||
| DXGI_FORMAT_BC4_UNORM = 80 |
There was a problem hiding this comment.
A note that you may or may not care about - I'm hoping to get #6486 merged before the next release. If it is merged in time, then I would remove these new constants in favour of enums. You've absolutely done the right thing here, no need to change this PR, just letting you know that if you had plans to use these constants externally, things may not play out that way.
|
I've created sambvfx#1 to add some more test images - a PNG to compare the image against, and a TYPELESS variation of your test image. To be certain, this is what your image is supposed to look like, yes? |
Added test images
|
Thanks @radarhere, I've merged your changes. One odd thing to note is that the original PNG I used was simply the Tweaking the tests to compare against the ati1.png instead of the new one you added fails... There's a chance I'm doing something wrong, but I find that a little unexpected. |
|
The compression is lossy format, so it is not unexpected that converting to it created a slightly different file. Testing, I find that |
|
With #6486, this change is now mentioned in the release notes - https://pillow.readthedocs.io/en/latest/releasenotes/10.2.0.html#other-changes |

This fixes issues reading BC4 dds files.
The nvidia texture tool exporter generates BC4 dds files that use the DX10 header so that the exact DXGI format can be specified.