I'm doing some manipulation with images and need the image to be displayed correctly exactly as it is in the array. For some reason when I display image in iPython, they get modified. All solutions to this issue involve changing vmin and vmax to appropriate values, but for some reason they don't affect my image at all.
As you can see from the images, only the very first one is displayed as is. The rest of them have bizarre colors and changing the type or dynamic range with vmin and vmax does not seem to affect the output.
Here's my code:
image_files = os.listdir(all_folders[1])
im=os.path.join(all_folders[1], image_files[1])
plt.imshow(ndimage.imread(im))
plt.show()
plt.imshow(ndimage.imread(im).astype(int))
plt.show()
plt.imshow(ndimage.imread(im).astype(float))
plt.show()
plt.imshow(ndimage.imread(im).astype(int),vmin=0,vmax=255)
plt.show()
plt.imshow(ndimage.imread(im).astype(int),vmin=0,vmax=10)
plt.show()
plt.imshow(ndimage.imread(im).astype(int),vmin=0,vmax=1)
plt.show()
And here are the images I get: