Friday, July 25, 2008

Color Keying in Software

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.


This method uses solely the hue of a color, so that its saturation and value, such as in a shadow, are not relevant. This is a method that can be both used for RGB and HSV color spaces. The basic idea is that one defines an angle in the hue circle within the HSV color space; 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 an RGB color space, 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 color space exceeds at least 50% in order to eliminate all kinds of white, gray and black shades.


The human visual system is less sensitive to the position and motion of color than luminance; bandwidth can be optimized by storing more luminance detail than color detail. At normal viewing distances, there is no perceptible loss incurred by sampling the color detail at a lower rate. In video systems, this is achieved through the use of color difference components. The signal is divided into a luma (Y') component and two color difference components (chroma).


Chroma subsampling deviates from color science in that the luma and chroma components are formed as a weighted sum of gamma-corrected (tristimulus) R'G'B' components instead of linear (tristimulus) RGB components. As a result, luminance and color detail are not completely independent of one another. There is some "bleeding" of luminance and color information between the luma and chroma components. The error is greatest for highly-saturated colors and can be somewhat noticeable in between the magenta and green bars of a color bars test pattern (that has chroma subsampling applied). This engineering approximation (by reversing the order of operations between gamma corrections and forming the weighted sum) allows color sub sampling to be more easily implemented.

Wednesday, July 23, 2008

Chroma Key Photography Techniques

Since digital cameras became mainstream with pros, there's been an increasing interest in Chromakey photography. Chromakey is the process of using a green screen or blue screen as a background and then removing that background (and replacing it with something else) in software. Like many things in photography, shooting Chromakey is as much art as science. There's a learning curve, and you definitely want to try your set-up before throwing clients in front of it. There are a few components that go into a good Chromakey photo shoot: lighting, subject positioning, and the background. There are many different ways to combine these successfully, as they all interact with each other. What "works" will depend on your equipment, what the subject is, and the environment you're shooting in.



For amateur or hobbyist photographers and video producers, coming up with the money for a nice, $200 (and up!) backdrop and the expensive stands and hangers required to help support it isn't very easy. Rather, they need a way to make a nice-looking background that is both good looking and easy to transport.

In this article, I will show you how you can make a great portable backdrop frame that allows you to transport your backdrops and hang them at any height and width you would like—all for under $50, using parts from your local fabric and hardware stores. Getting a good chroma key, depends on more than only the background, and requires other equipment and computer software.


Fabric Options for Backgrounds/Backdrops and Chromakeying

In researching on the Internet, I have found many different opinions as to which fabric is the best to use for backdrops, which fabrics are best for green screening and blue screening, and what fabrics last longer with or without paint, etc.

In my experience, it is easiest to go to a fabric store (or a store with fabrics in it, such as Wal-Mart) with some ideas in mind, and look through all the different fabrics to find something that suits your purposes. If you want a plain and simple background, there are many solid color backgrounds; if you want something more radical, you could get one of the many cartoon character backgrounds, a 'clouds' background, etc. Prices for different fabrics vary widely (especially depending upon the width of the fabric), and I usually like narrower (around 48") fabric, because it's easier to manage (and it fits in my car for portability better!).

But I will offer my advice on a few specific types of backgrounds and what fabric/thickness works best for them. Also, when selecting a fabric, you must keep in mind how the lights you use (whether they are $30 halogen work lights or $500 soft boxes) reflect off the fabric. If you need to, ask for a sample of the fabric (these are usually free) and take some pictures of it under different lighting conditions.

See my guide for lighting for photography and video (not yet posted) and lighting for green/blue screen compositing or chromakeying (not yet posted)

Fabric types/backgrounds:



  • Muslin is a strong, sturdy fabric for painting on, or as a simple white or tan-colored backdrop. You can use acrylic or oil paints (found at art supply stores) or paints you can find at home-supply stores to make professional-looking backdrops for portraits and the like. The only problem with muslin is that it is prone to wrinkling (but this may not matter if you paint it. Be sure to wash the muslin right after you buy it and iron it to get out as many of the wrinkles you can. Make sure you buy PVC or metal piping that is sturdy enough to hold some of the thicker muslins. Do a Google search for 'paint muslin backdrop' to find out more?

  • Cotton, one of the more common fabrics found in a fabric store, is fairly easy to keep clean, but not so easy to paint on. Cotton is best for solid dyed colors. Make sure you wash and iron the backdrop before rolling it, or the wrinkles may be very hard to remove!

  • Rayon is a very lightweight fabric that can be had for a low price and is easy to transport, roll, and keep wrinkle-free. However, because it is so thin, you have to be careful when lighting it (sometimes lights behind the screen will make the lighting very uneven).

  • Polyester is a very low maintenance fabric, and is relatively easy to keep wrinkle-free. Simply make sure you've washed and dried it, and then take it out as soon as you can to avoid wrinkles. Light reflects off polyester a little brighter than most cotton, so make sure you account for that when lighting backdrops. You can purchase polyester in many different thicknesses (and many different prices); make sure your backdrop support frame is sturdy enough to hold it.


For Compositing: Professionals usually have access to professional-quality blue and green paints and fabrics for building high-quality backdrops. However, the average photographer or videographer does not have so much money. In my experience, the 'greenest green' or 'bluest blue' you can find will work fairly well (especially for photographs which you'd like to edit in Photoshop).

Friday, July 18, 2008

Chromakeys

Discover the full power of green screen, animation, color grading and masking with Composite Lab Pro. If you want to make a superhero fly or go invisible, turn actors into giants, create picture-in-picture presentations or color grade your movies to look cinematic, Composite Lab Pro has everything you need.


Chromakeying 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.


And the popular cure-all seems to be the proper lighting of your Chromakey wall (or back-drop). Not just a wimpy little 100 watt light aimed somewhere in the general direction of the background, but a host of lights that literally flood the background.

We’re talking a minimum of two 250 watt quartz halogens aimed at the backdrop from high and off to each side so that they will not inadvertently cast any shadows from your key subject (who should be standing at least three feet out from the backdrop).

The key subject should be illuminated with it’s own key light (another 250 watt plus) that is preferably diffused with either an umbrella or a diffusion filter.

If your camera and Panasonic MX-50 video mixer will not recognize your background as a solid, evenly lit blue, then the Chroma Keying will go crazy trying to determine where the background ends and the key subject begins.

Hence, the “jaggies.”

Every now and then, the background color of blue will reflect back onto the key subject. And this, of course, will cause background video to be keyed in onto the key subject, which you don’t want to do.

This reflected blue can be mostly eliminated by placing light colored amber gels over your background lights (the two lights that flood your backdrop). More specifically, ask for “bastard amber” at your local photo shop when purchasing these gels. They’ll know what you’re talking about.

As for the key subject light, place it about three or four feet off to one side or the other of the camera so as not to cast any direct shadows onto the background.


Once you have adjusted your “hue” and “slice” control on the Panasonic WJ-MX50 for optimum Chroma-key effect that you view on your monitor, slight adjustments of the angle and location of all of your lights will make the effect that much better.