Closed dirago closed 1 month ago
Palette-based PNG output is a lossy process, so further decode/encode roundtrips will throw away more data each time. You could try reducing the quality
setting from its default of 100 if you want palette-based output and value smaller file size over "quality". You'll need to experiment with a suitable value for your given scenario.
- transformer = transformer.png({ palette: true });
+ transformer = transformer.png({ quality: 50 });
Thanks for your answer @lovell, I played a lot with the given options, especially with quality but I was not able to get a conclusive result
What are you trying to achieve?
hey there, I just wrote a script using sharp for minifying png assets for a vue3 project. Everything works great but if I have to launch the script multiple times for having a "perfect minification" (meaning sharp can no longer reduce file size)
I would like the file size reduction to be done in one step, is it possible?
When you searched for similar issues, what did you find that might be related?
I didn't find anything about this, but maybe I'm doing something wrong?
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question
here's my script:
Please provide sample image(s) that help explain this question