为什么灰度工作的方式呢

为什么灰度工作的方式呢

本文介绍了为什么灰度工作的方式呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的原始问题

我读到将RGB像素转换为灰度RGB,应该使用

I read that to convert a RGB pixel into greyscale RGB, one should use

r_new = g_new = b_new = r_old * 0.3 + g_old * 0.59 + b_old * 0.11

我也阅读并理解, g 有更高的权重,因为人眼对绿色更敏感。实现这一点,我看到的结果是一样的,我会从图像编辑器中设置一个图像为'greyscale'像Gimp。

I also read, and understand, that g has a higher weighting because the human eye is more sensitive to green. Implementing that, I saw the results were the same as I would get from setting an image to 'greyscale' in an image editor like the Gimp.

在我读这之前,我想象,要将像素转换为灰度,将会将其转换为HSL或HSV,然后将饱和度设置为零(因此,删除所有颜色)。但是,当我这样做,我有一个完全不同的图像输出,即使它也缺乏颜色。

Before I read this, I imagined that to convert a pixel to greyscale, one would convert it to HSL or HSV, then set the saturation to zero (hence, removing all colour). However, when I did this, I got a quite different image output, even though it also lacked colour.

s = 0 完全不同于我阅读的正确方式,为什么它不正确?

How does s = 0 exactly differ from the 'correct' way I read, and why is it 'incorrect'?

基于答案和其他研究的正在进行的研究

看来使用的亮度系数是一些争论的主题。各种组合和灰度级算法具有不同的结果。以下是在诸如电视标准的区域中使用的一些预设:

It appears that which luminance coefficients to use is the subject of some debate. Various combinations and to-greyscale algorithms have different results. The following are some presets used in areas like TV standards:


  • 由ITU-R BT.601(NTSC? code> 0.299r + 0.587g + 0.114b

  • 由ITU-R BT.709(更新)定义的系数 0.2126r + 0.7152g + 0.0722b

  • 等于三分之一的系数,(1/3)(rgb)等效于 s = 0

  • the coefficients defined by ITU-R BT.601 (NTSC?) are 0.299r + 0.587g + 0.114b
  • the coefficients defined by ITU-R BT.709 (newer) are 0.2126r + 0.7152g + 0.0722b
  • the coefficients of equal thirds, (1/3)(rgb), is equivalent to s = 0

href =http://www.cgg.cvut.cz/members/cadikm/color_to_gray_evaluation/ =nofollow>科学文章详细描述各种灰度技术及其对各种图像的结果,加上119的主观调查

This scientific article details various greyscale techniques and their results for various images, plus subjective survey of 119 people.

然而,当将图像转换为灰度时,为了实现最好的艺术效果,几乎肯定不会使用这些预定义的系数,

However, when converting an image to greyscale, to achieve the 'best' artistic effect, one will almost certainly not be using these predefined coefficients, but tweaking the contribution from each channel to produce the best output for the particular image.

推荐答案

虽然这些变换系数存在,但没有什么绑定你使用它们。只要每个像素的总强度不变,来自每个通道的贡献可以是从0到100%的任何值。

Although these transformation coefficients exist, nothing binds you to using them. As long as the total intensity of each pixel is unchanged, the contributions from each channel can be anything, ranging from 0 to 100%.

将图像转换为灰度的摄影师使用通道混合器调整每个通道的电平(RGB或CMYK)。在你的形象中,有许多红色和绿色,所以可能需要(根据你的意图)让那些通道在灰度级强度上比蓝色更高。

Photographers converting images to grayscale use channel mixers to adjust levels of each channel (RGB or CMYK). In your image, there are many reds and greens, so it might be desirable (depending on your intent) to have those channels more highly represented in the gray level intensity than the blue.

这是区分科学转换的图像从一个艺术组合的乐队。

This is what distinguishes "scientific" transformation of the image from an "artistic" combination of the bands.

另外一个考虑是值的动态范围在每个并尝试将其保存在灰度图像中。例如,提高阴影和/或高光可能需要增加蓝色带的贡献。

An additional consideration is the dynamic range of values in each band, and attempting to preserve them in the grayscale image. Boosting shadows and/or highlights might require increasing the contribution of the blue band, for example.

这篇关于为什么灰度工作的方式呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 16:25