Image Transformation: Grayscale to Color
2016-08-23
0 0 0
4.0
Other
Earn points
Translated by maninwest@Codeforge Author:Maxim_Barsuk @ Codeproject
This is an easy algorithm of image transformation from grayscale image to color. It's far from ideal, but it is very simple.
Background
Usually we calculate gray color as:
Gray = Green * 0.59 + Blue * 0.30 + Red * 0.11;Gray = Green * 0.59 + Blue * 0.30 + Red * 0.11;
Each color with structure [Gray, Gray, Gray] has a set of colors:
G = [Gray, Gray, Gray] G -> P = {C}, for each C from P: Green * 0.59 + Blue * 0.30 + Red * 0.11 = Gray.
First of all, we create a set of control points. Control point is equivalent of "gray" color and "full" color. When we have control points set, we can approximate any "gray" color to "full" color. If "gray" color is located between two control points C1 and C2, then the color approximates as:
c#
图像
转换
灰色
彩色
Related Source Codes
No. 186: DX0110- Source code for community propert
0
0
no vote
No. 219: DX0149- Source code for community propert
0
0
no vote
Verification code identification
0
0
no vote
CSV data analysis tool
0
0
no vote
Source code of hospital medical record information
0
0
no vote
No comment