11MorePixelsByIndexNumber-noTemple

11MorePixelsByIndexNumber-noTemple - CS1315: Introduction...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS1315: Introduction to Media Computation More referencing pixels directly by index number: Red eye and mirroring Removing Red Eye When the flash of the camera catches the eye just right (especially with light colored eyes), we get bounce back from the back of the retina. Result: red eye We can replace the red with a color of our choosing. Find where the eyes are (x, y) using MediaTools Removing Red Eye def removeRedEye(pic, startX, startY, endX, endY, replacementColor): red = makeColor (255, 0, 0) for x in range (startX, endX + 1): for y in range (startY, endY + 1): currentPixel = getPixel (pic, x, y) if ( distance (red, getColor (currentPixel)) < 165): setColor (currentPixel, replacementColor) What were doing here: Within the rectangle of pixels (startX, startY) to (endX, endY) Find pixels close to red, then replace them with a new color replacementColor Why use a range? Because we dont want to replace her red dress! Fixing it: Changing red to black...
View Full Document

This note was uploaded on 01/26/2012 for the course CS 1315 taught by Professor Sweat during the Fall '08 term at Georgia Institute of Technology.

Page1 / 11

11MorePixelsByIndexNumber-noTemple - CS1315: Introduction...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online