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

DDS BC6 decoding has a broken blue channel #6344

Closed
expenses opened this issue Jun 1, 2022 · 3 comments · Fixed by #6449 or ShadelessFox/Pillow#2
Closed

DDS BC6 decoding has a broken blue channel #6344

expenses opened this issue Jun 1, 2022 · 3 comments · Fixed by #6449 or ShadelessFox/Pillow#2

Comments

@expenses
Copy link

expenses commented Jun 1, 2022

I attempted to use the code in https://github.com/python-pillow/Pillow/blob/main/src/libImaging/BcnDecode.c for a project in order to decode BC6 textures. The red and green channels decoded correctly but the blue channel ended up being mangled somehow.

Here's the red channel of the image as displayed in renderdoc:
20220601_16h17m43s_grim

and here's the blue channel:

20220601_16h17m52s_grim

This results in an image that looks like this:

20220601_15h56m13s_grim

What are your OS, Python and Pillow versions?

  • OS: N/A
  • Python: N/A
  • Pillow: b261e17
@radarhere
Copy link
Member

Would we be able to get a copy of the image itself?

@expenses
Copy link
Author

expenses commented Jun 2, 2022

I've uploaded the source image (which is a cubemap with several mip levels) in 2 formats, .dds and .ktx2:

broken.zip

As the broken output .dds file is quite large (128mb) it exceeds the 25mb upload limit unless I make a non-trivial modification. Let me know if you'd like me to send that to you by another means though!

@radarhere
Copy link
Member

Thanks for the image.

I'm not happy with it enough yet for a PR, but see what you think of radarhere@3b51e1c. It generates this from your image.

@radarhere radarhere changed the title BC6 decoding has a broken blue channel DDS BC6 decoding has a broken blue channel Jun 4, 2022
REDxEYE added a commit to REDxEYE/bcndecode that referenced this issue May 3, 2024
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 a pull request may close this issue.

2 participants