In [2]:
from numpy import *
In [3]:
from scipy.misc import imsave
In [4]:
h = 500
w = 800
a = zeros((h,w,3),dtype=uint8)
#a[:,:,2] = 100

a[:2*h//3,:2*w//3,0] = 255

imsave('myimage.png',a)