fengyuanchen / compressorjs

JavaScript image compressor.
https://fengyuanchen.github.io/compressorjs/
MIT License
5.23k stars 438 forks source link

Loses Transparency In PNG Image #184

Open choudhary-ankit opened 10 months ago

choudhary-ankit commented 10 months ago

While attempting to compress a PNG image, it loses its transparency. I have tried specifying the mimeType value as both 'auto' and 'image/png', but in both cases, the PNG image loses its transparency. Can you help fix this issue?

Ramishscrapper commented 8 months ago

I also facing the issue in the png that I cannot compress the png file

image

fengyuanchen commented 8 months ago

If you set the mimeType option to 'image/png', you may also need to set the strict option to false.

Kivt commented 1 month ago

As mentioned here:

Set the convertTypes option to [] or ''. Or set the convertSize option to Infinity.