Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myFile=pickAFile()
- picture=makePicture(myFile)
- pictureDup=duplicatePicture(picture)
- show(picture)
- editImage()
- def editImage():
- action=requestString("*** Picture Modifications ***\nm - make monochrome (black-and-white image)\nl - make the image Lighter\nd - make the image Darker\nu - undo\no - reset the picture to the Original\nq - quit")
- if (action == "l"):
- for pxl in getPixels(picture):
- color = getColor(pxl)
- color = makeLighter(color)
- setColor(pxl, color)
- repaint(picture)
- editImage()
- elif (action == "d"):
- for pxl in getPixels(picture):
- color = getColor(pxl)
- color = makeDarker(color)
- setColor(pxl, color)
- repaint(picture)
- editImage()
- elif (action == "m"):
- for pxl in getPixels(picture):
- OGColor = (getRed(pxl)+getGreen(pxl)+getBlue(pxl))/3
- setColor(pxl,makeColor(OGColor, OGColor,OGColor))
- repaint(picture)
- editImage()
- elif (action== "o"):
- show(pictureDup)
- editImage()
- elif (action == "q"):
- printNow("quit")
Add Comment
Please, Sign In to add comment