Comments (4)
I think that would be reasonable.
The uncompressed formats should be relatively straightforward and the texpresso
crate supports BC1-BC5, so I it shouldn't be too difficult if you wanted to support those as well. But BC6H or BC7 or anything else would be more complicated
(There's actually also code for DXT compression in this crate, but it is both very slow and produces low quality output, so I'd really like to remove it...)
from image.
Yep. The process for decompressing DXT is deterministic* but compression is more complex. Each 4x4 block of pixels gets its assigned a shared set of parameters. Different choices of parameters will be better for some pixels in the 4x4 block and worse for others, so you generally want to search through a whole bunch of different options for them to see which is best overall. But searching all 2^32 (or closer to 2^64 for BC7!) options is very expensive, so you need to be smart about which to try
*It turns out different implementations use subtly different deterministic formulas for decoding.
from image.
Ive been doodling on a rust library for doing DXT compression (I already made one in C/Python), and there's a number of difficulties in doing it thats vastly different from other image formats.
The containers themselves have things like cube maps, mipmaps, image arrays, 3d textures, etc, which might be adaptable from the animation system here, but there's also things like how to handle alpha (is It premultiplied or not? it matters a lot if you're rescaling!) or the myriad of encoder settings that these block compression formats need. Some formats are 2-channel. some formats have 1-bit alpha. some formats are YUV
I don't think fitting it into image-rs is impossible, but the enum-based image format system kinda gets in the way. The sheer amount of code to make the encoders and decoders work well and quickly is probably better suited to a standalone library
from image.
is DXT compression not deterministic? I haven't actually looked into what it would take to implement.
from image.
Related Issues (20)
- Add in-place versions of all rotation operations HOT 1
- `DynamicImage::crop()` is slow because `to_image()` is slow HOT 1
- Cropping API doesn't check bounds, easy to misuse HOT 7
- EnumeratePixels and EnumerateRows should implement DoubleEndedIterator HOT 3
- Implement a `rows()` iterator on `SubImage` HOT 6
- how to convert a rgbaImage to opencv's Mat?
- Regression: Hot lib reload, unable to find __rust_alloc. HOT 6
- Increased generation loss in JPEG encoder HOT 1
- Broken link in docs HOT 2
- Should the next major release be 1.0? HOT 2
- Detect alpha on jpeg HOT 2
- Alternate versions of the crates which allow regular breaking changes HOT 7
- Animated WebP decoding error HOT 8
- “Corrupt RLE data” on simple BMP
- Make set_icc_profile function accessible
- Blur for images with alpha is incorrect, bleeds color from transparent pixels HOT 4
- Not reproducible crash in png module
- Error: PNG image and JPEG failed loading
- Calling `resize` returns a `ImageBuffer <Rgba<_>, _>` for `DynamicImage` HOT 1
- updating from image v0.24 to image v0.25 is causing colour distortions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image.