image
image copied to clipboard
Deprecate codecs::dxt
Quoting myself in https://github.com/image-rs/image/pull/1495#issuecomment-863390561:
Right now our GPU compressed texture handling is really not all that great. For decoding we don't support any of the newer formats like BC6, BC7 or ASTC, And for encoding, our code is slow, low quality, and doesn't support any of the newer formats.
As a result, pretty much any use of the module would be better served by squish-rs which implements faster and higher quality encoding (though be sure to use 2.0.0-beta1 or later to get the recent bugfixes).
Additionally, unlike the other codecs, DXT is not actually an image file format but rather a compression format. This distinction matters for instance because it means that the DxtDecoder::new() has to be passed the image metadata unlike all our other decoders which don't need that. My suggestion is to just completely deprecate (and eventually remove) the codecs::dxt module. We can still keep the codecs::dds by porting it to rely on squish-rs instead.
reached here while checking for basis universal support. It seems squish is archived now.
work continuing at https://github.com/jansol/texpresso
https://github.com/jansol/texpresso/issues/1 issue discussing integration with image crate
Yeah, I decided to archive the squish code in its state that still mostly resembles the original C++ implementation.
With texpresso I have no qualms changing the API so if the image crate has any preferences in that regard, please let me know! (I intend to do some more heavy-handed modifications to the overall code base anyway)
If it's useful for anyone, I've implemented BC7 decoder without any dependencies here: https://github.com/Shadlock0133/bigblob-decoder/blob/16f8f16d947c7b85f0df9c81b3cc3aaa2850d225/src/bc7/decode.rs
As the original author of the DXT codec, that's fine with me. I wrote it for another project (which didn't need full DDS support) when there wasn't any other rust impl of the algorithm yet, and figured it'd be useful for other people. It's pretty ad hoc and just brute-forces some of the harder parts of the algorithm so it's indeed fairly slow. If a better implementation exists, by all means use it instead.