当管道数为3的时候就是彩图了
默认为1的时候就是灰图
import cv2
import numpy
import os
randomByteArray = bytearray(os.urandom(120000))
flatNumpyArray = numpy.array(randomByteArray)
RandomColor = flatNumpyArray.reshape(200, 200, 3)
cv2.imwrite('RandomColor.png', RandomColor)
RandomGray = flatNumpyArray.reshape(400, 300)
cv2.imwrite('RandomGray.png', RandomGray)