Reputation: 55
I am trying to build an image manipulation API using ImageMagick.I am not able to compress the PNG images to the required level. How do I imitate this https://blog.imgix.com/2016/03/11/auto-compress.html behavior for PNG's using ImageMagick!!
Upvotes: 0
Views: 212
Reputation: 21
PNG compression is lossless. Therefore, there is a image size reduction limit.
The article in question says:
...
auto=compress reduced the file size by over 99%, with no loss in quality.
Note: Files without transparency will be output as JPEG. If your illustrations are saved as PNG without transparency, this will lead to a loss in image quality.
So, if auto=compress gets a PNG image without transparency, it converts it to JPEG.
EDIT: Also, have you considered looking at existing APIs like the API of the CloudImage service? They use better algorithms and I think it is worth to look into it.
Upvotes: 1