loops – I need some help creating some function in python using PIL for image manipulation

1) get_flip (img, axis) #axis is horizontal or vertical

2) make_grayscale (img)

(see https://web.stanford.edu/class/cs101/image-6-grayscale-adva.html for converting color to grayscale)

3)change_intensity (img, band, adjustment)

      band is r, g, b or a;
      adjustment is a number: .5 would reduce the value by half; 2 would double it
4) get_mirror (img, axis, start=0)

      # axis is horizontal or vertical
      # start value is 0 (zero) or "mid", which will determine whether the mirror is of the left (or top) half of the image or the right (or bottom) half
5) replace_color (img, old_color, new_color, max_distance = 0)

only the Image class of the Python Imaging Library, and the only methods should be used