I believe the issue lies in the following line:
Image.fromarray(np.asarray([blueAmount,blueAmount,blueAmount])
The numpy array you use here would have shape (3, x, y) rather than (x, y, 3) which may have been your intention.