I have a numpy array with shape (3, 256, 256) which is a 3 channel (RGB) image of resoulution 256x256. I am trying to save this to disk with Image
(3, 256, 256)
Image
You can use opencv to do merge three channel and save as img.
import cv2 import numpy as np arr = np.random.uniform(size=(3,256,256))*255 # It's a r,g,b array img = cv2.merge((arr[2], arr[1], arr[0])) # Use opencv to merge as b,g,r cv2.imwrite('out.png', img)