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 support for reading ATI1/ATI2 (BC4/BC5) DDS images #6457

Merged
merged 6 commits into from Jul 27, 2022

Conversation

REDxEYE
Copy link
Contributor

@REDxEYE REDxEYE commented Jul 22, 2022

This commit adds support for loading DDS with ATI1 and ATI2 fourcc pixel format

Changes proposed in this pull request:

  • Add support for ATI1 dds files
  • Add support for ATI2 dds files

This commit adds support for loading DDS with ATI1 and ATI2 fourcc pixel format
@REDxEYE
Copy link
Contributor Author

REDxEYE commented Jul 22, 2022

I haven't found the ATI1 texture yet, I will add a test for ATI1 when I find texture

Test texture is taken from Zombie Army 4

@REDxEYE
Copy link
Contributor Author

REDxEYE commented Jul 22, 2022

Quick question, how should I go about DDS cube maps? Does pillow support layers or something like it?
If not, should I flatten multi-side/layer textures into one line?

@radarhere
Copy link
Member

Quick question, how should I go about DDS cube maps? Does pillow support layers or something like it? If not, should I flatten multi-side/layer textures into one line?

Pillow has a concept of 'frames'. While used for the different images for in an animated GIF, they are also used for the different layers in a PSD. You might want to look at https://github.com/python-pillow/Pillow/blob/main/src/PIL/PsdImagePlugin.py

@radarhere
Copy link
Member

Test texture is taken from Zombie Army 4

Is that something that can be distributed under Pillow's license as part of our test suite?

@REDxEYE
Copy link
Contributor Author

REDxEYE commented Jul 23, 2022

Test texture is taken from Zombie Army 4

Is that something that can be distributed under Pillow's license as part of our test suite?

I'll replace them with selfmade textures in next commit

@REDxEYE
Copy link
Contributor Author

REDxEYE commented Jul 27, 2022

@radarhere Do you have any estimations of when this PR will be merged? I have other PR in progress that needs changes from this one

@radarhere
Copy link
Member

All looks good. My only suggestion is to rearrange the order of the formats - https://github.com/REDxEYE/Pillow/pull/1/files

I think this can be merged after that.

@REDxEYE
Copy link
Contributor Author

REDxEYE commented Jul 27, 2022

Good idea, I forgot to sort them. I'm also working on a full rewrite of DDS plugin, using proper enums and flags with support for more pixel formats, but i'm stuck at floating point formats, is there any plans on adding RGBAF32 format or something?

@radarhere radarhere added the automerge Automatically merge PRs that are ready label Jul 27, 2022
@radarhere
Copy link
Member

Sounds like you're talking about #1888

@mergify mergify bot merged commit 87a08e2 into python-pillow:main Jul 27, 2022
@radarhere radarhere changed the title Add support for ATI1/2(BC4/BC5) DDS files Added support for ATI1/ATI2 (BC4/BC5) DDS images Jul 27, 2022
@radarhere radarhere changed the title Added support for ATI1/ATI2 (BC4/BC5) DDS images Added support for reading ATI1/ATI2 (BC4/BC5) DDS images Jul 27, 2022
@hugovk
Copy link
Member

hugovk commented Jul 27, 2022

Let's also add this to the release notes. Thanks!

https://pillow.readthedocs.io/en/latest/releasenotes/9.3.0.html

@REDxEYE REDxEYE deleted the ATI1-2_support branch July 27, 2022 17:37
radarhere added a commit to radarhere/Pillow that referenced this pull request Jul 27, 2022
@radarhere
Copy link
Member

Ok, I've created #6465 to add to the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PRs that are ready Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants