Split Image Channels to Red, Green and Blue Using Python OpenCV

In this tutorial, we will learn how to split an image to red, green and blue, we will use python opencv to implement it.

1. Import library

import cv2

2. Read an image

img = cv2.imread('C:/Users/N/Desktop/bgr.png')

3. Split an image to red, green and blue

blue, green, red = cv2.split(img)

4. Show red, green and blue images

cv2.imshow('blue', blue)
cv2.imshow('green', green)
cv2.imshow('red', red)
 
cv2.waitKey(0)
cv2.destroyAllWindows()