Sainath
Sainath

Reputation: 55

how to remove the transparency backgrounds of an image using ImageMagick?Which function should i use to remove the CSS transparency grid?

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

Answers (1)

Philip Michaylov
Philip Michaylov

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

Related Questions