I have found the answer. Instead of using im.split (), which converted the group to grayscale, I had to convert the image to an array, multiply the groups that I don't want by 0, and then returned back to the Image object.
By importing the image and numpy, I did the following:
a = Image.open("image.jpg") a = numpy.array(a) a[:,:,0] *=0 a[:,:,1] *=0 a = Image.fromarray(a) a.show()
This will display a blue image.
source share