Answer the following conceptual question
for times in range(5): print(times)
for character in "INQ241 A": print(character)
picture = makePicture(pickAFile()) for pixel in picture: print(pixel)
picture = makePicture(pickAFile()) for pixel in picture: print(getRed(pixel))
picture = makePicture(pickAFile()) for pixel in picture: print(getGreen(pixel))
picture = makePicture(pickAFile()) for x in range(getWidth(picture)): for y in range(getHeight(picture)): pixel = getPixel(picture, x, y) print(getBlue(pixel)
picture = makePicture(pickAFile()) for pixel in picture: setRed(pixel, 0) for x in range(getWidth(picture)): for y in range(getHiehgt(picture)): pixel = getPixel(picture, x, y) print(pixel)
picture = makePicture(pickAFile()) for pixel in picture: redColor = getRed(pixel) setRed(pixel, redColor / 2) greenColor = getGreen(pixel) setGreen(pixel, greenColor / 2) blueColor = getBlue(pixel) setBlue(pixel, blueColor / 2) for x in range(getWidth(picture)): for y in range(getHeight(picture)): pixel = getPixel(picture, x, y) print(pixel)
For the following Python programs, draw what is drawn to the image.
picture = makeEmptyPicture(4, 4) for y in range(getHeight(picture)): pixel = getPixel(picture, 1, y) setRed(pixel, 255)
picture = makeEmptyPicture(4, 4) for x in range(getHeight(picture)): pixel = getPixel(picture, 1, x) setRed(pixel, 255)
picture = makeEmptyPicture(4, 4) for x in range(getHeight(picture)): pixel = getPixel(picture, 1, x) setRed(pixel, 255) pixel = getPixel(picture, x, 1) setRed(pixel, 255)
For the following problem, write your solution ON PAPER.
negativeRed(a_picture)
. This
function should convert all of the red values of each pixel to be
the photonegative value. The photonegative value would be the
result of subtracting the current red value from 255.