Kayla Dean & Patrick Baker. Original Picture Sunset def sunset(filename): filename = makePicture(pickAFile()) explore(filename) for p in getPixels(filename):

Slides:



Advertisements
Similar presentations
Python: Modifying Pictures Using Loops. Review JES command area – program area Defining/using functions specifying a sequence of steps for what the function.
Advertisements

01-IntroToMediaComp1 Barb Ericson Georgia Institute of Technology Oct 2010 Introduction to Computer Science and Media Computation.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 3: Modifying Pictures using Loops.
Graphics in Python using the JES environment
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 5: Advanced Picture Techniques.
+ Introduction to Programming My first red-eye removal.
First Courses Workshop Day 1 Mark Guzdial College of Computing Georgia Institute of Technology
UWCSE BRIDGE Workshop Aug. 31 – Sept. 3, 2009 Hal Perkins Computer Science & Engineering University of Washington
Spring  Evolving Lists & Lights On!  Caesar Cipher  Looks Good!
Picture Color Manipulation. Using a Loop Our first picture recipe def decreaseRed(picture): for p in getPixels(picture): value=getRed(p) setRed(p,value*0.5)
Chapter 6: Modifying Pixels by Position. Chapter Learning Goals.
Replacing colors using if We don’t have to do one-to-one changes or replacements of color We can use if to decide if we want to make a change.  We could.
Studying a Reflection. Create a reflection Place the Communicator ® on top of the Transformation Grid and Chart template Locate the three vertices: A(1,0),
02-RangesInPictures1 Barb Ericson Georgia Institute of Technology Oct 2010 Working with ranges in pictures.
CS1315: Introduction to Media Computation Referencing pixels directly by index number.
Manipulating Pixels by Range and More on Functions.
CS2984: Introduction to Media Computation Using Loops for Pictures Conditionals Copying images.
MAT 150 – Class #24 Topics: Graphing Rational Functions Asymptotes Vertical Slanted Horizontals Holes.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 3: Modifying Pictures using Loops.
Media Computation Workshop Day 1 Mark Guzdial College of Computing Georgia Institute of Technology
UsingSoundRanges-part21 Processing Sound Ranges part 2 Barb Ericson Georgia Institute of Technology Oct 2009.
1 CS 177 Week 5 Recitation Slides Mirroring and copying images, Using for Loop, if statement, and range.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 4: Modifying Pixels in a Range.
CS 101: Introduction to Computing Color replacements and targeted color replacement (if statement) Developed by Mark Guzdial, Georgia Institute of Technology,
ManipulatingPictures-Mod6-part61 Manipulating Pictures, Arrays, and Loops: Eliminating color, Inversion, grey scale and adjusting for luminance Barb Ericson.
03-ConditionalsInPictures Barb Ericson Georgia Institute of Technology Feb 2010 Working with ranges in pictures.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 5: Advanced Picture Techniques.
Chapter 5: Advanced Picture Techniques (partial deck)
Chapter 5: Advanced Picture Techniques. Chapter Objectives.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 3: Modifying Pictures using Loops.
01-IntroToMediaComp1 Barb Ericson Georgia Institute of Technology Feb 2010 Introduction to Computer Science and Media Computation.
CS1315: Introduction to Media Computation Color replacements and targeted color replacement (IF)
Python Programming in Context Chapter 6. Objectives To understand pixel based image processing To use nested iteration To use and understand tuples To.
Yet Another Version. More Careful Edge Detection def lineDetect(filename): orig = makePicture(filename) makeBw = makePicture(filename) for x in range(0,getWidth(orig)-1):
CS1315: Introduction to Media Computation Using Loops for Pictures.
Chapter 3: Modifying Pictures using Loops. Chapter Learning Objectives.
A Media Computation Cookbook Manipulating Images and Sounds for Use in Alice Part 1: Image Manipulations Part 2: Advanced Image Manipulations, e.g., changing.
Chapter 6: Modifying Pixels by Position
CS 101: Introduction to Computing Programs that change Pictures Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004; modified by Robert.
MAT 150 – Class #16 Topics: Graphing Rational Functions Asymptotes Vertical Slanted Horizontals Holes.
Python: Working with pixels. Reminder: Conditionals if age < 18: showInformation(“Sorry, not allowed to vote yet.”) else: showInformation(“Please select.
Intro CS and Media Computation1 Barb Ericson Georgia Institute of Technology Feb 2010 Introduction to Computer Science and Media Computation.
Notes Over 9.2 Graphing a Rational Function The graph of a has the following characteristics. Horizontal asymptotes: center: Then plot 2 points to the.
CS1315: Introduction to Media Computation Making sense of functions.
1 CS 177 Week 4 Recitation Slides for Loop if statement and range.
CS 101: Introduction to Computing Referencing pixels directly by index number Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004; modified.
Python/JES JES IDE (Integrated Development Environment)
Chapter 4: Modifying Pictures using Loops
Spring 2010 EECS 110: Homework III.
Download JES Tool JES: Jython Environment for Students
Week 2.
Picture Functions ppp =makePicture(pickAFile())
Lab 9 Intro to Robots.
CS1315: Introduction to Media Computation
Chapter 4: Modifying Pictures using Loops
Chapter 3: Modifying Pictures using Loops
CS1315: Introduction to Media Computation
Chapter 3: Modifying Pictures using Loops
Gray Scale picture def pixBW(pixel): # given a pixel, change to BW
Agenda – 1/31/18 Questions? Group practice problems
Graph Transformations
Spring 2015.
Python Practice !!!.
Manipulating Pictures, Arrays, and Loops
Manipulating Pictures, Arrays, and Loops part 6
Chapter 3: Modifying Pictures using Loops
CS 101: Introduction to Computing
CS1315: Introduction to Media Computation
Multimedia Summer Camp
Manipulating Pictures, Arrays, and Loops part 6
Presentation transcript:

Kayla Dean & Patrick Baker

Original Picture

Sunset def sunset(filename): filename = makePicture(pickAFile()) explore(filename) for p in getPixels(filename): value = getBlue(p) setBlue(p, value * 0.7) value = getGreen(p) setGreen(p, value * 0.7) explore(filename)

Sunset Pict

Grayscale def grayscale(filename): filename = makePicture(pickAFile()) explore(filename) for p in getPixels(filename): sum = getRed(p) + getGreen(p) + getBlue(p) intensity = sum / 3 setColor(p, makeColor(intensity, intensity, intensity)) explore(filename)

Grayscale Pict

Mirror Vertical def mirrorVertical(filename): filename = makePicture(pickAFile()) explore(filename) mirrorPoint=getWidth(filename)/2 width=getWidth(filename) for y in range(0, getHeight(filename)): for x in range(0, mirrorPoint ): leftPixel=getPixel (filename, x, y) rightPixel=getPixel (filename, width- x-1,y) color=getColor(leftPixel) setColor(rightPixel,color) explore(filename)

Mirror Vertical Pict

Mirror Horizontal def mirrorHorizontal(filename): filename = makePicture(pickAFile()) explore(filename) mirrorPoint=getHeight(filename)/2 height=getHeight(filename) for x in range(0, getWidth(filename)): for y in range(0, mirrorPoint ): topPixel=getPixel (filename, x, y) bottomPixel=getPixel(filename, x,height-y-1) color=getColor(topPixel) setColor(bottomPixel,color) explore(filename)

Mirror Horizontal Pict

Line Detect def lineDetect(filename): filename = makePicture(pickAFile()) for p in getPixels(filename): newRed = getRed(p)*0.229 newGreen = getGreen(p)*0.587 newBlue = getBlue(p)*0.114 luminance = newRed+newGreen+newBlue setColor(p,makeColor(luminance,luminance,luminance)) orig = (filename) makeBw = (filename) sketchLine = getWidth(orig)/2 for x in range(0,sketchLine): for y in range(0,getHeight(orig)-1): here=getPixel(makeBw,x,y) down=getPixel(orig,x,y+1) right=getPixel(orig,x+1,y) hereL=(getRed(here)+getGreen(here)+getBlue(here))/3 downL=(getRed(down)+getGreen(down)+getBlue(down))/3 rightL=(getRed(right)+getGreen(right)+getBlue(right))/3 if abs(hereL-downL)>=10 and abs(hereL-rightL)>=10: setColor(here,black) if abs(hereL-downL)<=10 and abs(hereL-rightL)<=10: setColor(here,white) show(makeBw) return makeBw

Line Detect Pict

Negate Blue def negateblue(filename): filename = makePicture(pickAFile()) for p in getPixels(filename): setBlue(p,0) show(filename)

Negate Blue Pict

Negative def negative(filename): filename = makePicture(pickAFile()) for px in getPixels(filename): red = getRed(px) green = getGreen(px) blue = getBlue(px) negColor = makeColor( 255-red, 255- green, 255-blue) setColor(px, negColor) explore(filename)

Negative Pict

Negate Green def negategreen(filename): filename = makePicture(pickAFile()) for p in getPixels(filename): setGreen(p,0) show(filename)

Negate Green Pict

Negate Red def negatered(filename): filename = makePicture(pickAFile()) for p in getPixels(filename): setRed(p,0) show(filename)

Negate Red Pict

Make Green def green(filename): filename = makePicture(pickAFile()) for p in getPixels(filename): setRed(p,0) setBlue(p,0) show(filename)

Make Green Pict

Make Red def red(filename): filename = makePicture(pickAFile()) for p in getPixels(filename): setGreen(p,0) setBlue(p,0) show(filename)

Make Red Pict

Make Blue def blue(filename): filename = makePicture(pickAFile()) for p in getPixels(filename): setRed(p,0) setGreen(p,0) show(filename)

Make Blue Pict

Other Codes def filename(): filename=makePicture(pickAFile()) def sketchline(): sketchline = getWidth(filename)/2

Source allery.all/web/lion.cub.c jz3f42 56.b-600.html allery.all/web/lion.cub.c jz3f42 56.b-600.html Site for Original Picture.