C#:为什么减小图像大小会导致图像质量非常差?我可以做任何事

标签 c# image-processing

前几天,我问了一个关于how to reduce the size of an image while keeping its ratio's dimensions的问题。我终于能够让它工作了。现在,当用户上传图像时,它的 3 个副本(具有不同的尺寸)将保存到数据库中。

但是,不幸的是,尺寸的减小明显降低了上传图像的质量。只有保存的没有尺寸的副本才能保持其质量。

我应该预料到质量会下降吗?图像看起来真的很糟糕(就像报纸的照片)。

有什么我可以做的吗?我需要在代码中设置一个强大的选项。

感谢您的帮助

最佳答案

原因是因为Image.GetThumbnailImage您正在使用的功能仅用于制作低质量的图像。

请参阅有关 GetThumbnailImage 的 MSDN 文档中的这些注释:

The GetThumbnailImage method works well when the requested thumbnail image has a size of about 120 x 120 pixels. If you request a large thumbnail image (for example, 300 x 300) from an Image that has an embedded thumbnail, there could be a noticeable loss of quality in the thumbnail image. It might be better to scale the main image (instead of scaling the embedded thumbnail) by calling the DrawImage method.

有关如何在 C# 中执行高质量图像缩放的一个很好的示例,请参阅以下问题:

High Quality Image Scaling C#

关于C#:为什么减小图像大小会导致图像质量非常差?我可以做任何事,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4306260/

相关文章:

c# - 如何在 ms 图表中旋转特定标签?

image-processing - 如何检测图像中的热点

matlab - 如何计算图像轮廓的 'roundness shape feature'的值?

C# 静态与实例方法

c# - .Net Web 服务书籍

c# - 如何在 c# asp html 中制作具有 tiles 样式的树?

image-processing - 获取 ITK 中的区域最小坐标

python - 如何使用 Python 将图像从一种格式转换为另一种格式?

image-processing - CUDA 或 OpenCV 上的图像处理?

c# - 使用烛台时的空白图表