如何将图片调整为特定的文件大小? [英] How to resize a picture to a specific file size ?
本文介绍了如何将图片调整为特定的文件大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将图片调整为特定的文件大小.例如,不超过200KB.
用C#.NET实现此目标的最佳方法是什么?
谢谢!
Hi,
I would like to resize a picture to a specific file size. For example, no more than 200KB.
What is the best approach to achieve this with C# .NET ?
Thanks !
推荐答案
您可以调整颜色深度,图像尺寸,压缩率等...
无论如何,只有使用未压缩的图片文件(例如bitmap
s),您才能获得确定的结果.对于压缩的图像(例如jpeg
图像),我怀疑您必须采用逐次逼近法.
:)
You may adjust color-depth, image dimensions, compression ratio, etc...
Anyway you''ll obtain a deterministic result only with uncompressed picture files (e.g.bitmap
s). For compressed ones (for instancejpeg
images) I suspect you''ve to go with successive approximations.
:)
这篇关于如何将图片调整为特定的文件大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文