使用ImageMagick将图像转换为灰度非常暗 [英] Image conversion to Grayscale using ImageMagick is very dark

查看:440
本文介绍了使用ImageMagick将图像转换为灰度非常暗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过

convert infile -colorspace Gray outfile

单色。但结果是所有图像都很暗。这里有一个示例转换:原始照片转换单色图片

to monochrome. However the result is for all images very dark. Here a sample conversion: original photo and converted monochrome image.

有没有更好的方法将使用ImageMagick的照片般逼真的图像转换为灰度?

Is there a better way to convert a photo-realistic image with ImageMagick to gray-scale?

推荐答案

文档指出,在更改颜色空间时,颜色会在转换前从其原始伽玛转换为线性。你需要将它们转换回适当的伽玛值。

The documentation states that when changing the color space, the colors are converted from their original gamma to linear before the conversion. You need to convert them back to an appropriate gamma.

convert infile -colorspace Gray -gamma 2.2 outfile

这篇关于使用ImageMagick将图像转换为灰度非常暗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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