1 min read
I want to convert my png image to RGB image using Python Programming Language. How can I do that thing?
Vishal Sharma Answered question July 16, 2019
1 min read
You can use PIL library for this purpose. It makes the task very easier.
You should use convert() method:
from PIL import Image  open_image = Image.open("image_name.png") rgb_image = open_image.convert('RGB') rgb_image.save('output_image.jpg')
For more information: http://pillow.readthedocs.io/en/latest/reference/Image.html#PIL.Image.Image.convert
This method is very useful,when you are working on object detection method.Because model can create error if you try to use two different types of images in the training dataset.
Vishal Sharma Edited answer July 16, 2019