如何使用c#检查程序中的图像质量?
我想使用我的应用程序检查照片是否适合打印。我该怎么做?我对照片质量不太了解?每张照片的分辨率是否相同?
I want to check out whether the photograph is suitable for print or not using my application.How can I do that?I don't know much about photo quality?Is the resolution of every photograph is same or not?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您可以确定地检查打印质量的唯一因素(因为其他因素是主观的)是图像的分辨率与预期的打印尺寸。如果您有其他具体要求,例如图像必须是彩色的,而不是黑白的,您也可以检查一下。但试图识别图像是否太模糊、对比度太低等,很可能是徒劳的,因为你永远不知道图像是否是有意为之。
一个常见的经验法则是,打印时每英寸至少应有 240 个点,300 个点更好。当然,对于高质量打印机,更高的分辨率可以产生更好的结果,如果您要打印非常高的细节,例如精细文本,您可能需要达到 600dpi 及以上。
因此,要使用最小 240 dpi 的数字打印 8" x 10" 图像,您需要的图像至少为 1920 x 2400 像素(总共 4,608,000 像素,或约 4.5 兆像素)。
如果您决定打印 8" x 10" 时至少需要 300dpi,那么您需要至少 2400 x 3000 像素的图像,即大约 7 兆像素。
提高到 600dpi?在这种情况下,您需要大约 28 兆像素的图像。
示例:
I think the only factor in print quality that you can check with any certainty (because the other factors are subjective), is the resolution of the image vs. the intended print size. If you have other tangible requirements, like the image must be color, not black and white, you can check for that too. But trying to identify whether an image is too blurry, low contrast, etc., will likely be a fruitless pursuit, as you never know whether the image was intended to be that way or not.
A common rule of thumb is that you should have at least 240 dots per inch when printing, and 300 is even better. Of course with quality printers, higher resolution than that can yield better results, and if you are printing very high detail, like fine text, you may want to go to 600dpi and above.
So to print an 8" x 10" image using the minimum figure of 240 dpi, you would want an image that is at least 1920 x 2400 pixels (a total of 4,608,000 pixels, or about 4.5 megapixels).
If you decide you want at least 300dpi when printing an 8" x 10", then you want an image with at least 2400 x 3000 pixels, which is about 7 megapixels.
Stepping up to 600dpi? You'll need about a 28 megapixel image in that case.
Example:
有很多因素可以区分图像的“质量好”和“质量差”
维基百科有一个简短的这些因素列表
其中大多数都很难以编程方式检查,并且涉及复杂的成像算法。然而,如果分辨率是好坏图像之间的唯一标准,那么检查分辨率很容易。
这个简单的代码告诉你如何做到这一点
我认为获得解决方案的最基本代码是这样的
There are a great many factors that will differentiate an image that is "of good quality" and "of bad quality"
wikipedia has a short list of those factors
Most of these are rather hard to check for programatically and involve complex imaging algorithms. Checking for resolution is easy however, if it is the only criteria between a good and a bad image.
This simple code tells you how to do it
I think the most basic code to get resolution is this