# Title and Short Description of Program # By: FirstName LastName # Define Functions # Define main method # Run main method main() |
pickAFile() | Select a file (picture) from file system on computer |
makePicture(input) |
Creates an array of Pixels in JES |
show(input) |
Displays a picture from array of
Pixels to the computer screen |
setRed(p,
value) |
Sets Red value for a given Pixel
in a picture. |
setBlue(p,
value) |
Sets Blue value for a given
Pixel in a picture. |
setGreen(p,
value) |
Sets Green value for a given
Pixel in a picture. |
getPixels(input) |
Returns a list of all the pixels
in a picture Array. |
Required: 1. Select picture from library to edit. 2. Write a function to select and convert a picture file to an array. 3. Write three functions: a. Remove all the Red and Blue Pixels from picture and show. (Green Only) b. Remove all the Red and Green Pixels from picture show. (Blue Only) c. Remove all the Green and Blue Pixels from the picture and show. (Red Only) 4. Run functions and take Screenshots of each picture. 5. Save program and pictures to Student's file area. (Use Screen Shot to save pictures) a. MyNamePictures.py b. MyNameGreen.jpg c. MyNameBlue.jpg d. MyNameRed.jpg Extras: 1. Read Pages 67 to 71 in Introduction to Computing and Programming in Python and write additional functions for Negative and Grayscale. 2. Save these pictures to your file area. |
# Pictures and Arrays # FirstName LastName # Define Functions # This function allows user # to select a picture and display to the screen def pickAndShowPicture(): Pic = pickAFile() Pic = makePicture(Pic) show(Pic) # Function to return an Array of pixels for a picture def pickAndMakePicture(): Pic = pickAFile() Pic = makePicture(Pic) return Pic # Make the picture Green only def keepGreen(pic): for p in getPixels(pic): setBlue(p,0) setRed(p,0) show(pic) # Make the picture Blue only # Write your function here # Make the picture Red only # Write your function here def main(): Pic1 = pickAndMakePicture() Pic1 = keepGreen(Pic1) # Run main method main() |
![]() |
![]() |
Original
Picture |
Green
Picture |
Does
Not Meet the Standard |
Meets
the Standard |
Exceeds
the Standard |
|
Format of Code |
No use of comments. No main method. No Description of program. |
Uses comments to define sections
of program. Uses main method. |
Comments are concise and
description. Sections of program are clearly laid out. |
Function and Content of Program |
Program does not run. Did not complete Red or Blue Functions. Pictures and or Program are not saved to File Area. |
Program runs without
errors. Red, Green, and Blue pictures and program are saved to file area. |
Created additional functions for
grayScale() and negative(). Saved additional grayscale and negative pictuers to file area. |