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

Support DXT1, DXT3 and DXT5 DDS encoding #4864

Open
SerVB opened this issue Aug 13, 2020 · 7 comments
Open

Support DXT1, DXT3 and DXT5 DDS encoding #4864

SerVB opened this issue Aug 13, 2020 · 7 comments

Comments

@SerVB
Copy link

SerVB commented Aug 13, 2020

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.

@radarhere
Copy link
Member

I've created #5402 to add RGB saving at least.

@radarhere
Copy link
Member

radarhere commented Apr 13, 2021

I've pushed another commit to the PR to add RGBA as well, resolving this issue - unless you have anything further to add.

@SerVB
Copy link
Author

SerVB commented Apr 13, 2021

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.

@radarhere
Copy link
Member

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.

@SerVB
Copy link
Author

SerVB commented Apr 13, 2021

Let's leave it open.

@radarhere radarhere changed the title DDS write support Support DXT1, DXT3 and DXT5 DDS encoding May 15, 2021
@jrd
Copy link

jrd commented Nov 6, 2021

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…

@radarhere
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants