Reputation: 2399
A Python package that I'm trying to use only works with 3-channel images. If I have a grayscale PNG image, Pillow's Image.open()
naturally reads it as a single-layer image. How can I use Pillow to transform the 1-channel image into a 3-channel RGB image?
Upvotes: 5
Views: 3704
Reputation: 207883
The simplest method to convert a single-channel greyscale image into a 3-channel RGB image with PIL is probably like this:
RGB = Image.open('image.png').convert('RGB')
Further discussion and explanation is available here.
Upvotes: 6