-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for reading DX10 BC4 DDS images #7603
Conversation
@@ -98,6 +98,8 @@ | |||
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27 | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#6486 has now been merged
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.