-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Support DXT1, DXT3 and DXT5 DDS encoding #4864
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
Comments
I've created #5402 to add RGB saving at least. |
I've pushed another commit to the PR to add RGBA as well, resolving this issue - unless you have anything further to add. |
Thanks a lot for your efforts. Which DDS formats does writing support? Ideally, it would be great to have all: DXT1, DXT3, and DXT5. And thank you specially for RGBA, because it's what I've needed. |
Ah, ok. At the moment, it only saves uncompressed data - so not DXT1, DXT3, DXT5 or DX10. That's a level more complex, and not something I'm going to attempt. We can leave this issue open for those additional formats though if you want. |
Let's leave it open. |
Can someone point me the documentation to the DDS (DXTn) format/spec please? I could try to implement the DXT1 (and therefore DXT3 and 5) compression write support if possible… |
A while ago, I attempted to implement DXT1 - https://github.com/radarhere/Pillow/tree/dds. Feel free to take that and build on it if you want. I hit a wall when I realised that it was a lossy encoding, so I wasn't going to be a single perfect solution, and using someone else's logic would probably be better. https://github.com/nothings/stb/blob/master/stb_dxt.h seemed good, but I didn't return to this. You asked for documentation though. Here are links that I found helpful |
Did this get implemented? I would like to save a file as a |
No, this hasn't been implemented yet. |
I am also wishing for Here is the implementation used by Paint.NET - https://github.com/0xC0000054/pdn-ddsfiletype-plus |
I've created #8807 to resolve this. With it, you can saving DXT1, DXT3, DXT5, BC2 or BC3 with im.save("out.dds", pixel_format="DXT1") |
Hi! Currently DDS is a read-only format: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html?highlight=format#dds. This issue asks to add support for saving DDS images.
The text was updated successfully, but these errors were encountered: