什么是用于调节亮度的颜色矩阵?
搜索周围有很多关于将图像转换为亮度(黑白)或调整饱和度而不改变亮度的信息。但如何修改亮度本身呢?例如,如何使用 5x5 矩阵增加红色通道亮度?最终这将在 C 中使用,但相同的数学应该适用于 java 或 flash。
Searching around there is lots of information on converting an image to luminance (B&W) or adjusting saturation w/out changing luminance. But how can you modify luminance itself? For instance, how can I increase the red channel luminance using a 5x5 matrix? Ultimately this will be used in C but the same math should work w/java or flash.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于从 google 来到这里的任何人,这里是缩放亮度的矩阵:
其中
l
- 亮度乘数,rl
- 红色亮度(sRGB 为 0.213),gl
— 绿色亮度(sRGB 为 0.715),bl
— 蓝色亮度(sRGB 为 0.072)。请注意:此矩阵可能很容易产生色域外的颜色,因此当您期望获得准确的结果时,请勿使用它。例如,对于
1, 0, 0, 1
向量和l=2
它将产生1.213, 0.213, 0.213, 1
结果。从技术上讲,该矢量具有预期的亮度 (0.426),但显示的颜色将约为 0.381。For anyone who came here from google, here is the matrix to scale luminance:
where
l
— luminance multiplier,rl
— red luminance (0.213 for sRGB),gl
— green luminance (0.715 for sRGB),bl
— blue luminance (0.072 for sRGB).Please note: this matrix may easily produce out of gamut colors, so don’t use it when you expect accurate results. For example, for the
1, 0, 0, 1
vector andl=2
it will produce the1.213, 0.213, 0.213, 1
result. Technically, this vector has the expected luminance (0.426), but the displayed color will be ≈0.381.我相信你同样改变所有三个颜色值,所以......
要缩放 RGB 颜色,使用这样的矩阵:
来自: http://www.graficaobscura.com/matrix/index.html
I believe you change all three color values equally so...
To scale RGB colors a matrix like this is used:
From: http://www.graficaobscura.com/matrix/index.html