Question: Starting Code: def red_part_of_an_image(image): red_image = image.clone() # copy the image # go across the image with the for x loop and then move down
Starting Code:
def red_part_of_an_image(image): red_image = image.clone() # copy the image # go across the image with the for x loop and then move down a row for y in range(0,image.getHeight()): for x in range(0,image.getWidth()): color = image.getPixel(x,y) # get the pixel color red_color = color[0] # pull out the red component new_color = [red_color, 0, 0] # Zero out the green and blue red_image.setPixel(x,y, new_color) # Set the pixel to the new color return red_image # return the finished new image
Make a function that makes a photonegative of the original. # The red value should be set to 255 - original red, green to 255 - original green # and the same for the blue value. def photonegative_of_an_image(image):
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
