Chroma-key-composite.pfp Chroma-key compositing demonstration. In this demonstration, a green-screen portrait is first reduced in size to 1/5 its original width and height. A background image that is roughly the same size as the reduction is then adjusted in size to match the size of the reduction. Then the compositing is performed. The test for whether we are in the face or the background is based only on the hue. If the hue is between 0.35 and 0.42, then the program judges it to be green. That means that the destination pixel should come from the background scene rather than the green-screen portrait. Otherwise, we take the pixel from the portrait. There are artifactual pixels in the hair and at the boundaries of the shirt, and managing such artifacts is one of the challenges of green-screen compositing. BEGIN FORMULA BARS 1#|#Green-screen portrait#|##|##|#@server:tanimoto:tanimoto-green-screen.JPG#|#c#|#Original image, full sized#|#100,50 2#|#reduction#|#(774,518)#|#1,*#|#s1(x*w1/w, y*h1/h)#|#c#|#Reduction.#|#100,50 3#|#Urban scene#|##|##|#@server:tanimoto:PikeMarketBHemingway.jpg#|#c#|#Original image, full sized#|#100,50 4#|#reduction#|#Size(2)#|#3,*#|#s1(x*w1/w, y*h1/h)#|#c#|#Version that's the same size as the reduced green-screen portrait#|#100,50 5#|#Composite#|#Size(2)#|#2,4#|#if hue1(x,y)>0.35 and hue1(x,y)<0.42 then s2(x,y) else s1(x,y)#|#c#|#Version that's the same size as the reduced green-screen portrait#|#100,50