< Back

INQ 241 A

Images Homework

Name:
 

Write programs which would accomplish the following program descriptions.

  1. Write a Python function remove_blue(a_picture), which sets the blue component of each pixel to 0 in the image. It should leave the red and green component of each pixel alone.

  2. Write a Python function swap_red_blue(a_picture), which swaps the values for the red and blue components of each pixel. It should leave green component of each pixel alone.