Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Data Science by (18.4k points)
I wanted to separate the RGB channels from the Image to perform individual operations on the one. Now I am trying to add them together. Kindly Suggest something.

1 Answer

0 votes
by (36.8k points)

You can just make a copy of your original image and then replace your channels with the copy using your RGB produced.

For Example:

img_cpy =img.copy()

img_cpy[:,:,0]=r

img_cpy[:,:,1]=g

img_cpy[:,:,2]=b

Make sure shapes do match.

Do you wish to learn Data Science from scratch? Enroll in this Data Science Courses

Browse Categories

...