I hope this will be a pretty straight forward question. I am working on processing some images that I read in from FITS files into numpy arrays. I want to make an RGB image. The issue is that when I make the RGB image, there is this 'white haze' that seems to appear. Alternatively, I know that the areas that are black should be black in this image, but instead they look grey. The greens from the G image are coming through pretty nicely. It just looks like there is a white haze or fog over the whole image. I thought maybe it was an issue with setting alpha? Note setting the A in RBGA to 0 and 255 didn't help the issue.
Here is an image example -- I would show it except I do not have enough reputation points. Unfortunately in this case a picture is worth a 1000 words...
And here is the code I am using to do this image processing:
testrgb = np.zeros([512,512,4])
#
# converting read in image to float
tmpr = asi1r.astype('float')
tmpg = asi1g.astype('float')
tmpb = asi1b.astype('float')
#http://akash0x53.github.io/blog/2013/04/29/normalization/ pretty obvious
tmptotal = tmpr+tmpg+tmpb
R = tmpr/tmptotal
G = tmpg/tmptotal
B = tmpb/tmptotal
# eliminate the nans in the division
R[np.isnan(R) == True] = 0.
G[np.isnan(G) == True] = 0.
B[np.isnan(B) == True] = 0.
testrgb[:,:,0] = R*255.
testrgb[:,:,1] = G*255. #asi1g.astype('float')
testrgb[:,:,2] = B*255. #asi1b.astype('float')
testrgb[:,:,3] = 255.
testrgb = testrgb.astype('uint8')
f = plt.figure(figsize=(4,4), dpi=300)
plt.imshow(testrgb,cmap='jet',vmin=0,vmax=200)
plt.colorbar()
plt.show()
f.savefig('test.png')
plt.close('all')
Any help would be appreciated. Thank you.