Code Monkey home page Code Monkey logo

Comments (8)

fintelia avatar fintelia commented on July 17, 2024 1

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.

fintelia avatar fintelia commented on July 17, 2024

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.

nricciardi avatar nricciardi commented on July 17, 2024

Which details are needed?

However, I compile my application in release mode (optimization 3).

I will try to inspect code...

from image.

nricciardi avatar nricciardi commented on July 17, 2024

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.

fintelia avatar fintelia commented on July 17, 2024

The PNG encoder is already heavily optimized. AVIF as well, but you'll want to enable the nasm feature for best performance

from image.

nricciardi avatar nricciardi commented on July 17, 2024

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.

fintelia avatar fintelia commented on July 17, 2024

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.

nricciardi avatar nricciardi commented on July 17, 2024

Thank you, I will try it!

from image.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.