'python PIL Image open isn't RGB
i've been trying to open a .jpg image using
im = Image.open('file.jpg').
my problem is that for some reason the "im" is not an RGB image, i.e the channels are not R,G,B. this also cause the im.convert('L') (rgb2gray) give a very bad result.
channel 0 image, attemped gray sacale.
Im using: Python 2.7.12 |Anaconda 4.1.1 (64-bit)
I would very much appreciate any help figuring this out.
edit: it seems the problem is that the matplotlib color map isn't set right. does anyone know why? and how to fix?
Solution 1:[1]
You can find current mode in im.mode and do convert with im.convert('RGB').
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | homm |
