Comments (8)
To start with it would help to know which image format(s) you're dealing with. But even that isn't much to go on. Many of our encoders/decoders are thousands of lines of code and have already had a significant amount of optimization. In some cases they are slow primarily just due to the complexity of the format
The most actionable things would probably be providing specific image files that decode much faster with other libraries or profiling data identifying particular slow sections that could be improved
from image.
Make sure you are compiling in release mode / with optimizations. Beyond that, this issue really isn't actionable without a lot more detail
PR's for specific optimizations are of course welcome!
from image.
Which details are needed?
However, I compile my application in release mode (optimization 3).
I will try to inspect code...
from image.
I always encode in PNG (output format, which then is encoded in base64 to be printed in html). I wanted to encode in AVIF (I need a transparent background format), but it is not out-of-the-box format...
from image.
The PNG encoder is already heavily optimized. AVIF as well, but you'll want to enable the nasm
feature for best performance
from image.
Thank you, but, then I don't know how open
and write_to
are so a time consuming tasks...
Anyway, how can I use AVIF and what is nasm
feature?
from image.
The functions are time consuming because they do a lot of work. Just because each step is efficient doesn't mean it still won't take a while to complete.
You can encode to AVIF the same way you're currently doing for PNG, just change the file extension or pass ImageFormat::Avif
as applicable. The nasm
feature enables the asm
feature on rav1e which you can read about in their readme
from image.
Thank you, I will try it!
from image.
Related Issues (20)
- Invert Alpha method HOT 5
- Switch to the `rgb` crate `v0.9` pixel types and trait. HOT 1
- Format error decoding Png: Invalid PNG signature. When reading png with embedded color profile HOT 4
- Building with default features on macOS requires rustc v1.79 or newer. HOT 7
- Creating a new `PixelImage` type. HOT 6
- Animated WebP's cannot actually be loaded HOT 3
- Animated PNG is decoded incorrectly HOT 1
- Bug-Triage: Should image codec bug reports be moved to their upstream repos?
- The image crate is a top-5 bandwidth consumer on crates.io HOT 1
- Accidentally pushed to main HOT 1
- Floating point image generates incorrect thumbnail
- DynamicImage:from SubImage<&DynamicImage>::to_image creates Rgba8 instead of L16 HOT 3
- Thread panics on EXR containing NAN HOT 1
- Support for bottom-up and right-to-left images
- SVG image "format could not be determined" HOT 3
- JPG image first two bytes are not an SOI marker HOT 1
- Panic when checking broken tiff file HOT 1
- Freeze when trying to open and save jpg and webp files
- Random crashes when decoding exr file 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.