Chroma key programming

From Wikipedia, the free encyclopedia

This article is about how chroma keying can be achieved within the context of computer programming

Chroma keying is a technique that is used to remove a color from an image and show a different image in place of that color. In this article different quality and speed optimized techniques will be shown regarding how one can make color keying in software.

[edit] HSV lookup technique

This method uses solely the hue of a color, so that it's saturation and value, such as in a shadow, are not relevant. This is a method that can be both used for RGB and HSV colorspaces. The basic idea is that one defines an angle in the hue circle within the HSV colorspace, this angle is your chromakey. For every pixel being drawn one looks up its hue value, compares it to the defined angle to determine its alpha channel value. In the case of a RGB colorspace, the RGB value has to be converted to HSV to do the lookup (see Transformation from RGB to HSV). It is also advised to check if the value V within the HSV colorspace exceeds at least 50% in order to eliminate all kinds of white, gray and black shades.

[edit] See also

[edit] External links