我试图压缩图像但没有成功。
看看我的小实验
var results = new Dictionary<int, int>();
for (int i = 0; i <= 100; i++)
{
var stream = new MemoryStream();
image.Quality = i;
image.CompressionMethod = CompressionMethod.Zip;
image.Write(stream, MagickFormat.Png);
results[i] = stream.GetBuffer().Length;
stream.Flush();
}
var best = results.OrderBy(e => e.Value).First();
// the same length as for original image. quality doesn't work in this example - dictionary values are identical
有人能指出我正确的方向吗?
我已经在这里阅读了一些详细信息ImageMagick:PNG 的无损最大压缩?