颜色渐变节点

../../../_images/compositing_node-types_CompositorNodeValToRGB.png

颜色渐变节点。

颜色渐变节点使用渐变的方式进行颜色值的匹配。

输入

系数

系数输入连接端口用于颜色渐变的索引(即需要此节点处理的输入素材图片)。

属性

渐变色

渐变条控制项功能参见 颜色渐变部件

输出

图像

标准颜色输出。

Alpha

标准化遮罩输出。

示例

Alpha遮罩

An often overlooked use case of the Color Ramp is to create an alpha mask, or a mask that is overlaid on top of another image. Such a mask allows you to select parts of the background to be shown through.

../../../_images/compositing_types_converter_color-ramp_create-alpha-mask.png

使用颜色渐变节点来创建alpha遮罩。

In the map above, a black-and-white swirl image, which is lacking an alpha channel, is fed into the Color Ramp node as a Factor.

“颜色渐变”节点在渐变的左端设置为纯透明颜色,而在右侧设置为全红色。正如您在“查看器”节点中看到的那样,“颜色渐变”节点将在图像为黑色的地方放出完全透明的蒙版。黑色为零,因此“颜色渐变”将在渐变的左端输出颜色,该颜色设置为透明。图像为白色(为1)的地方,颜色渐变图像为全红色且不透明。

You can verify that the output image mask is indeed transparent by overlaying it on top of another image.

彩色化图像

在此示例中,将多种颜色添加到颜色渐变中,从而将黑白图像转换为火焰状漩涡。

../../../_images/compositing_types_converter_color-ramp_colorizing-image.png

输入图像中的灰色阴影映射为三种颜色:蓝色,黄色和红色,全部完全不透明(alpha为1)。在图像为黑色的情况下,颜色渐变将替换为蓝色(第一个色标)。如果是灰色阴影,则“颜色渐变”会从渐变中输出相应的颜色(蓝色,黄色到红色)。在图像为全白的情况下,颜色渐变输出为红色。