I have 3 numpy arrays with Y, Cb and Cr. I was able to show them individually and now I want to merge them and show the result Image. I tried this:
Y, Cb, Cr = somefunction() //returns 3 numpy.ndarrays
print(Y.shape) //(160, 160)
print(Y.dtype) //float64
print(Cb.shape) //(160,160)
print(Cb.dtype) //float32
print(Cr.shape) //(160,160)
print(Cr.dtype) // float32
img_Y = im.fromarray(Y, mode=None)
img_Cb = im.fromarray(Cb, mode=None)
img_Cr = im.fromarray(Cr, mode=None)
im.merge('YCbCr', (img_Y, img_Cb, img_Cr))
but I get this error:
im.merge('YCbCr', (img_Y, img_Cb, img_Cr))
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\PIL\Image.py", line 2957, in merge
raise ValueError("mode mismatch")
ValueError: mode mismatch