PIL rotate image colors (BGR -> RGB)
I know it's an old question, but I had the same problem and solved it with:
img = img[:,:,::-1]
Just to add a more up to date answer:
With the new cv2 interface images loaded are now numpy arrays automatically.
But openCV cv2.imread() loads images as BGR while numpy.imread() loads them as RGB.
The easiest way to convert is to use openCV cvtColor.
import cv2
srcBGR = cv2.imread("sample.png")
destRGB = cv2.cvtColor(srcBGR, cv2.COLOR_BGR2RGB)