Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image processing 使用ImageMagick将图像转换为灰度非常暗_Image Processing_Imagemagick_Grayscale_Brightness_Monochrome - Fatal编程技术网

Image processing 使用ImageMagick将图像转换为灰度非常暗

Image processing 使用ImageMagick将图像转换为灰度非常暗,image-processing,imagemagick,grayscale,brightness,monochrome,Image Processing,Imagemagick,Grayscale,Brightness,Monochrome,我把一堆“普通”JPG照片通过 convert infile -colorspace Gray outfile 单色化。但是,结果是所有图像都非常暗。这里有一个转换示例:和 是否有更好的方法将带有ImageMagick的照片真实感图像转换为灰度 表示在更改颜色空间时,颜色在转换之前从其原始gamma转换为线性。您需要将它们转换回适当的gamma convert infile -colorspace Gray -gamma 2.2 outfile 听起来不错。你有例子吗?是的,刚刚添加了一个转

我把一堆“普通”JPG照片通过

convert infile -colorspace Gray outfile
单色化。但是,结果是所有图像都非常暗。这里有一个转换示例:和

是否有更好的方法将带有ImageMagick的照片真实感图像转换为灰度

表示在更改颜色空间时,颜色在转换之前从其原始gamma转换为线性。您需要将它们转换回适当的gamma

convert infile -colorspace Gray -gamma 2.2 outfile

听起来不错。你有例子吗?是的,刚刚添加了一个转换示例。好主意。有没有一种简单的方法可以找出jpg是用伽马“录制”的?@Halloeo,标准图像总是2.2,除非它们是在旧Mac上生成的。我刚刚发现了一个类似的问题。它说通过公式转换RGB值:Y=0.30 x红色+0.59 x绿色+0.11 x蓝色。在我看来,这是一种非常不同的方法。我必须同时做这两件事吗???我试试看。