Chromakey - PowerPoint PPT Presentation

chromakey n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Chromakey PowerPoint Presentation
play fullscreen
1 / 8
Chromakey
279 Views
Download Presentation
braith
Download Presentation

Chromakey

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Chromakey Barb Ericson Georgia Institute of Technology Oct 2010 Chromakey

  2. Chroma Key – Blue Screen • For TV and movie special effects they use a blue or green screen • Here just a blue sheet was used • Professionally you need an evenly lit, bright, pure blue background • With nothing blue in the scene Chromakey

  3. Chromakey Function def chromakey(source ,bg): # source should have something in front of blue # bg is the new background for x in range(0, getWidth(source )): for y in range(0, getHeight(source )): p = getPixel(source ,x,y) # if red + green < blue if (getRed(p) + getGreen(p) < getBlue(p)): setColor(p,getColor(getPixel(bg ,x,y))) return source Chromakey

  4. Testing chromakey markP = makePicture(getMediaPath("blue-mark.jpg")) newBack = makePicture(getMediaPath("moon-surface.jpg")) chromakey(markP,newBack) explore(markP) Chromakey

  5. Chromakey with a Greenscreen • Many movies use a green screen background for special effects • They use a program to replace the green background with a different background • We can do the same thing! Chromakey

  6. Chromakey Green def chromakeyGreen(source ,bg): # source should have something in front of a green background # bg is the new background for x in range(0, getWidth(source )): for y in range(0, getHeight(source )): p = getPixel(source ,x,y) # if green replace with new background if getGreen(p) > getBlue(p) + 10 and getGreen(p) > getRed(p) + 10: setColor(p,getColor(getPixel(bg ,x,y))) return source Chromakey

  7. Testing Chromakey Green jFile = getMediaPath("jenny2-green-small.jpg") jPict = makePicture(jFile) explore(jPict) bFile = getMediaPath("moon-surface.jpg") newBack = makePicture(bFile) chromakeyGreen(jPict,newBack) explore(jPict) Chromakey

  8. Challenge • Try copying just the non green pixels from the source picture (with the green background) to the new background • You can even specify where to start the copy at in the new background (initial x and y location) Chromakey