C#中的无损图像压缩 [英] Lossless image compression in C#

查看:264
本文介绍了C#中的无损图像压缩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想压缩我在网站上使用的jpeg图像的大小,我想要C#代码。我不想使用工具和处理程序来执行此操作。

Hi All,
I want to compress the size of jpeg images that I am using on my website, I want C# code for this. I dont want to use tools and Handlers to do it.

推荐答案

1)为什么不对这些代码项目文章中的内容进行讨论:

http://www.codeproject .com / search.aspx?q = image + compression& x = 5& y = 9& sbo = qa [ ^ ]



2)它是否压缩图像大小。当然。如果不进行压缩,压缩有什么意义?
1) Why don't you take a gander at some of these code project articles:
http://www.codeproject.com/search.aspx?q=image+compression&x=5&y=9&sbo=qa[^]

2) "Does it compress image size". Of course. What would be the point to compression if no compression takes place?


你想用无损压缩再次压缩有损jpeg?好吧,你可能不会成功。为什么?因为根据定义,有损压缩一般会比无损压缩更好,因为它会丢失信息细节。因此,即使jpg压缩图像本身是新的数据集,并且具有自己的结构,在第二次压缩后,您将获得更大的文件,或者至少不会更小。在特殊情况下,您可以在最后获得较小的文件。

您最好尝试为您的文件找到最合适的压缩比(品质因数)。一般来说,65-75%对网页图像有用。
You want to compress a lossy jpeg again with a lossless compression? Well, you will probably not succeed. Why? Because by definition a lossy compression will be able to compress better in general, than a lossless, since it will loose information details. So, even if the jpg compressed image itself is new set of data, and has it's own structure, you will get a bigger file in general after the second compression, or at least not smaller. In really special cases you can get smaller file at the end.
You better try to find the most suitable compression ration (quality factor) for your files. In general 65-75% is good for web page images.


这篇关于C#中的无损图像压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆