-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Formatting a png image file takes too long #2590
Comments
Hello, without the specific images it's hard to tell exactly what's different. The "6mb.png" file is palette-based, so that might take longer to decode, plus it is 3 channel, so might miss out on some auto-vectorised optimisations that only benefit 4 channel images. This code is setting The first thing to do for any PNG performance problem is reduce the - transformer = transformer.toFormat(format, { quality });
+ transformer = transformer.toFormat(format, { compressionLevel: 6 }); https://sharp.pixelplumbing.com/api-output#png If you're able to create a standalone repo with complete code and sample images, we can try to run it via callgrind to discover where CPU time is being spent.
Please see #2300 (comment) and subscribe to randy408/libspng#114 |
We are using sharpjs prebuilt with libvips binaries (as far as i know I will try to find a similar image with copyrights that will allow me to upload it in a public repo and let you know. Thank you very much for your help. |
We're planning to switch the prebuilt binaries to the SIMD-accelerated |
The next release will include zlib-ng in the prebuilt binaries - please subscribe to #2604 for updates. |
@klouvas You mention issue 526 twice. Do you still remember the third issue that you checked? |
Since i don't remember the 3rd issue i removed the 1 reference from 526. Thank you for pointing it out. |
Could you help me understand why a png image of 6MB takes 4x time longer compared to an 20MB image?
Also could you help me with the questions below:
Yes i have already checked:
Also most of the issues from https://github.com/lovell/sharp/issues?q=png+compress
I cannot provide the 6mb picture due to copyrights and i cannot attach the 20mb since it's too big. Those are some informations based on the code snippet above:
6mb metadata info:
20mb.png metadata info:
The text was updated successfully, but these errors were encountered: