image-conversion
image-conversion copied to clipboard
Image cannot be converted accurately to the size
Hi, thanks for the library. I have been trying to use the compressAccurately method to compress the image to certain size. However, when i am trying to compress an image of 3M, i set the config to {size: 100000, accuracy: 99} with same width and height as the original image. The image cannot be compressed to 100kb as wanted. It would end up be compressed image of around 300kb. Hence, would like to know what would be the reason of this. Thanks!
The default unit of size
is kb
Thanks for the reply. I think there is a typo in my previous comment. I meant to say i set the config to {size: 100, accuracy: 99} to compress the image accurately to 100kb. However, when i try to compress the image with size of around 2 to 3MB, the resulting image wont be accurately 100kb, but around 300kb.
Same here
you have to reduce image dimensions to make it work ex. compressAccurately(file, {size: 100, width:800, height: 600})
如果不想改变原始的长度和宽度怎么做