I'm trying to compress PNGs using sharp.js and I'm trying to find the correct values that I would like to use in the final program. I made a basic for loop that changes the quality parameter by 5, starting from 0 to 100. This works well until it reaches 15%, there is still some compression after that but the file size and photo overall looks the same (well I dont see any differences). Here is the function that I've called:
await sharp(img.data)
.png({
quality: i,
force: true,
})
.toFile(`./output/${i}.png`);
i is just the number and img.data is coming from an express server using the image in the post request (req.files.image).
Here is also what I see in file explorer (the file name corresponds to what i was when making the file):
For whatever reason, pallete size for any quality of 15~100 seems to be the same (probably because that's max pallete size)
Try to test the same thing for another image type (say, jpg) and another image with lesser amount of colors