I have an image where the colors are BGR. How can I transform my PIL image to swap the B and R elements of each pixel in an efficient manner?
import cv2 srcBGR = cv2.imread("sample.png") destRGB = cv2.cvtColor(srcBGR,cv2.COLOR_BGR2RGB)
Just to clarify Martin Beckets solution, as I am unable to comment. You need cv2. in front of the color constant.