I have hue, saturation and value of a color (HSV color-space). The color has to be set on a device that displays them incorrectly. If I specify white it displays light magenta. However, if you specify some green it displays the best white it can (let's say: gray). How do I remove this color cast? Actually: How do I create a color cast in the HSV numbers to compensate for the wrong display?

My approach was the following. But it lead to a skip of some magenta colors, when I ran through the whole rainbow with a saturation of, say, 0.8 (interval 0 to 1):

  • Shift magenta to the beginning of the hue scale (60 degrees forward) and thus the hue of the current color
  • Calculate the distance to move in the direction of green. With a saturation of 1 that means to move completely to green (180 degrees).
  • This is the formula: distance = (180 / 360 - shifted_hue) * (1 - saturation)
  • Then add the distance to the shifted hue (possibly resulting in a subtraction).
  • Shift the hue scale back by 60 degrees.

As said, this is leading to an ugly skip of some magenta colors, because the lower the saturation the bigger the gap at magenta.

Do you know of a better algorithm?


It is not necessary that your device's color mismatch can be corrected with a simple shifting of the Hue component (except of course if you are absolutely sure that this is the case with your equipment).

In general, to correct the response of the device you somehow need to recover the mapping that it already performs between reference and observed colors and then see how it can be corrected by some curve (monotonic or not).

For this purpose you will need a colour chart (and ideally, an instrument such as this one).

(Please note that it is best that this correction is applied at the system level, i.e. your application will still be sending some "color demand" normally, without correcting it but that demand would undergo some correction prior to display automatically by the system.)

At the very basic level, you can send a simple reference image to your display and then try to adjust its R,G,B settings (if there are any) so that the colours seem to display properly (according to your eyes that is)

If you have a system that is not capable of applying such profiles but you still must apply some color-correction you could try matching the relative distances of the colours with a known target (or image in your case) and then (if required) try to correct towards absolute colours by shifting (with trial and error).

Take an evenly lit image of the colour chart with a good digital camera, color correct it (to reduce any effects of the lighting or sensor used to acquire your "reference" image) and feed it to your display. Take an image of the display (ideally in the same lighting conditions), apply the same color correction with the profile from the first step (and for the same reasons) and then examine the relative color correspondence between any two colors from the color chart image and two colors from the color chart display image to recover the mapping. (A piece of software that might be of help in this process is LPROF)

  • $\begingroup$ The device can't display images with different colors. It has a general background light, and you can pass an RGB value for that. +++ I see that you can change the white point in such an ICC profile. But another thing I want to do is to stretch and compress the hue scale (because violet is passed to quickly, e.g.). Is this possible with ICC profiles, too? $\endgroup$ – human-man Jun 16 '12 at 1:30
  • $\begingroup$ Can i please ask you to update your question with a little bit more information? Because i am not sure that i understand the situation from this comment. As far as ICC profiles go, yes, colour can be completely re-mapped. (Is this a display device for some specialised purpose?) $\endgroup$ – A_A Jun 16 '12 at 21:32
  • $\begingroup$ I don't know how I could update the question. But I think your answer was enough for the moment. Thank you. $\endgroup$ – human-man Jun 22 '12 at 21:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.