def rgb888TOrgb565(img):
shape=img.shape
img_tmp = img.reshape((shape[0], shape[1]*shape[2]))
img_trans = img_tmp.transpose()
img_hwc = img_trans.copy().reshape((shape[1],shape[2],shape[0]))
img_new = image.Image(shape[2], shape[1], image.RGB888, alloc=image.ALLOC_REF,data =img_hwc)
img_565 = img_new.to_rgb565()
return img_565