Color Calibration - AEtHeLsYn/hyperion GitHub Wiki

To achieve a 'perfect' color we should follow these steps:

####Step 1. Whitelevel The led strips channels dont have always the same perceived amount of color, that's why when we see a white image the leds are a bit reddish, greenish or blueish. To correct that behaviour, we need to limit the output or one or two channels so we perceive a perfect white. To do that, here is a full white image pattern that we can use:

White PNG

To adjust the colors we have to change the part of the hyperion.config.json that lets us define the pure colors:

		"channelAdjustment" : 
		[
			{
				"id"   : "default",
				"leds" : "*",
				"pureRed" :
				{
					"redChannel"	: 255,
					"greenChannel"	: 0,
					"blueChannel"	: 0
				},
				"pureGreen" :
				{
					"redChannel"	: 0,
					"greenChannel"	: 255,
					"blueChannel"	: 0
				},
				"pureBlue" :
				{
					"redChannel"	: 0,
					"greenChannel"	: 0,
					"blueChannel"	: 255
				}			
			}		
		],		

At this first step, we only have the change the redChannel of pureRed, greenChannel of pureGreen and blueChannel of pureBlue until we get a pure White, the other values must be 0.

####Step 2. Gamma correction

Now that we have a corrected white, we need to adjust the perceived curves all the way from black to white. Here is a link that explains perfectly what happens with the perceived color levels:

The gamma issue

So, now we have a pure white and we have to adjust LED gamma levels. A good start is always setting a gamma level of 2.5 on each channel, here is the part of the code:

		"transform" :
		[
			{
				"id"   : "default",
				"leds" : "*",
				"hsl" :
				{
					"saturationGain" : 1.0000,
					"luminanceGain"  : 1.0000
				},
				"red" :
				{
					"threshold"  : 0.0000,
					"gamma"      : 2.5000,
				},
				"green" :
				{
					"threshold"  : 0.0000,
					"gamma"      : 2.5000,
				},
				"blue" :
				{
					"threshold"  : 0.0000,
					"gamma"      : 2.5000,
				}
			}
		],

As you can see there is the same amount of gamma calibration for each channel, but as we explained before the channels don't behave the same way, so gamma correction will not be the same for each channel. To help us with gamma calibration here are four more images:

Black
Grey (3F3F3F)
Grey (7F7F7F)
Grey (BFBFBF)

What you have to do is, by using these images, adjust gamma levels of each channel until you have the same perceived amount of each channel. For example, if your Grey (3F3F3F) is a bit reddish it means that we have to increase red gamma to reduce the amount of red (the more gamma, the less amount of color). When you have all the images with colors calibrated we can go to the next step.

###Step 3. Channel adjustment.

After we have the led strip gamma corrected and white leveled we can adjust the led strip colors. As you all know, there is really difficult to perceive the same color at the same time at display and led strip. That's because your TV/monitor does a color adjustment to the received imaged. Therefore, we should mimic that color adjustment to get the same color output. To help us with that here we have some image patterns:

red (FF0000)
green (00FF00)
blue (0000FF)
cyan (00FFFF)
magenta (FF00FF)
yellow (FFFF00)

What we should do here? Well, adjust LED channels using the same part of the configuration that we used at the beginning:

		"channelAdjustment" : 
		[
			{
				"id"   : "default",
				"leds" : "*",
				"pureRed" :
				{
					"redChannel"	: 255,
					"greenChannel"	: 0,
					"blueChannel"	: 0
				},
				"pureGreen" :
				{
					"redChannel"	: 0,
					"greenChannel"	: 255,
					"blueChannel"	: 0
				},
				"pureBlue" :
				{
					"redChannel"	: 0,
					"greenChannel"	: 0,
					"blueChannel"	: 255
				}			
			}		
		],		

This time, we must not change the redChannel of pureRed, greenChannel of pureGreen and blueChannel of pureBlue or we will lose all the whitelevel configuration. We should use first the RED, GREEN and BLUE patterns to get the same RED, GREEN and BLUE on led strips and TV. In my case, red and blue were right but I had to add a bit of red at pureGreen (about 25).

At this point, we will have the led strip almost calibrated. Just to be sure, check again whitelevel, gamma correction and all color patterns until you are satisfied with the result.

####Step 4. Color transform (optional)

You can perform some color transformations by increasing the luminance (the amount of "global white") and saturation (the amount of "global color". Also, you can set the color channel threshold. By setting a threshold what you are doing is deleting the color info of the lowest color values. So, if you set a threshold of 0.1000 on red channel, every red channel value between 0 and 25 (255*0.1) will be zeroed. You can set the configuration values by modifying this part of the config file:

		"transform" :
		[
			{
				"id"   : "default",
				"leds" : "*",
				"hsl" :
				{
					"saturationGain" : 1.0000,
					"luminanceGain"  : 1.0000
				},
				"red" :
				{
					"threshold"  : 0.0000,
					"gamma"      : 1.0000,
				},
				"green" :
				{
					"threshold"  : 0.0000,
					"gamma"      : 1.0000,
				},
				"blue" :
				{
					"threshold"  : 0.0000,
					"gamma"      : 1.0000,
				}
			}
		],

####Step 5. Color temperature (optional)

As a last step you can modify color temperature of the led strip. This involves changing the perception of all the colors, by "warming" them or "colding" them. You can find a lot of information and RGB values of temperature here:

Color temperature

You can set the temperature configuration values by modifying this part of the config file:

		"temperature" :
		[
			{
				"id"   : "default",
				"leds" : "*",
				"temperatureValues" :
				{
					"red"   : 255,
					"green" : 255,
					"blue"  : 255
				}
			}
		],