Best Way To Compress .PNG Image File?

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
GlennIM
Posts: 23
Joined: 2018-07-22T22:22:12-07:00
Authentication code: 1152

Best Way To Compress .PNG Image File?

Post by GlennIM »

What is the best way to compress a .PNG format file that ImageMagicK creates to make the image file smaller in size?

ImageOptimizer optimizer = new ImageOptimizer();

optimizer.LosslessCompress(imageMod);

Or...

optimizer.Compress(imageMod);
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Best Way To Compress .PNG Image File?

Post by dlemstra »

Compress will give you a better result but you might loose information from the file. If you only use the images in a website you should probably use the Compress method. But if you want to preserve the information from the original image you should use LosslessCompress instead. And make sure you also set the `OptimalCompression` property to true.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply