Jean-Patrick, Your general approach worked for me. I used a different function to normalize the data, and I created 'rgb' as a uint8 from the start rather than a float, but changing the dtype to float doesn't cause any problems on my system. Jonathan On Mon, May 23, 2011 at 5:59 AM, jp <jeanpatrick.pommier@gmail.com> wrote:
Hi,
I have written a script to try to combine five images into a three channels RGB images. The resulting RGB image looks like a grey scale image instead of a color one.
I have three np.array Rnorm, Gnorm, Bnorm which are copied into a rgb array:
rgb = np.zeros((shape[0],shape[1],3),dtype=float) mxr=np.max(R) mxg=np.max(G) mxb=np.max(B) Rnorm=np.uint8((255*(R/mxr))) Gnorm=np.uint8((255*(R/mxg))) Bnorm=np.uint8((255*(R/mxb))) #copy each RGB component in an RGB array rgb[:,:,0]=Rnorm rgb[:,:,1]=Gnorm rgb[:,:,2]=Bnorm
pylab.subplot(224, aspect='equal',frameon=False, xticks=[], yticks=[]) pylab.imshow(rgb) pylab.show()
Any advice?
Thank you
Jean-Patrick
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user