Skip to content
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 BC5U reading #7358

Merged
merged 1 commit into from Sep 4, 2023
Merged

Added BC5U reading #7358

merged 1 commit into from Sep 4, 2023

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Aug 31, 2023

#6486 refactors the DDS plugin, but also adds support for reading BC5U images. This PR adds that new support, without refactoring.

https://walbourn.github.io/the-dds-file-format-lives/ mentions

a FourCC of “BC5U” for the DXGI_FORMAT_BC5_UNORM format

Here are the settings we currently use for that format as part of DX10

if dxgi_format in (DXGI_FORMAT_BC5_TYPELESS, DXGI_FORMAT_BC5_UNORM):
self.pixel_format = "BC5"
n = 5
self._mode = "RGB"

So those same settings can be used when fourcc is "BC5U", making it the same as our existing fourcc of "ATI2"

elif fourcc == b"ATI2":
self.pixel_format = "BC5"
n = 5
self._mode = "RGB"

I created a test image by copying and hexeditting our ATI2 test image.

@hugovk hugovk merged commit 10d4595 into python-pillow:main Sep 4, 2023
53 checks passed
@radarhere radarhere deleted the bc5u branch September 4, 2023 21:10
radarhere added a commit to radarhere/Pillow that referenced this pull request Oct 7, 2023
hugovk added a commit that referenced this pull request Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants