#Brandon Zheng <bz1750@bard.edu> #Oct 30 2015 #CSMC 143 #Lab 7 -- Photobooth #Collaboration Statement: from Myro import * def resize(image,factor): newImage = copyPicture(image) for x in range(getWidth(image)): for y in range(getHeight(image)): target = getPixel(newImage,x,y) setPixel(newImage, x/factor,y/factor) return newImage def mirror(image): newImage = copyPicture(image) for x in range(getWidth(image)): for y in range(getHeight(image)): target = getPixel(newImage, x,y) setPixel() #swap def flip(image): newImage = copyPicture(image) for x in range(getWidth(image)): for y in range(getHeight(image)): setPixel() #swap x values with y values def photobooth(listOfImages): #Add heights of all the images and have a set width def picturebooth(): pictures = [] print("Get Ready!") for idx in range(5): beep(440,1) p = takePicture() wait(2) picutres = pictures + [p] def sepia(image, sepiaAmount): newImage = copyPicture(image) for x in range(getWidth(image)): for y in range(getHeight(image)): target = getPixel(newImage,x,y) #rgb function #r + 2*sepiaAmount #g + sepiaAmount #b - sepiaAmount
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question