Skip to content Skip to sidebar Skip to footer

Python Pil How Do I Convert 1 Bit Deep Images To Rgba?

Exactly like the title. I take a single-band image of mode '1' and open it using image = Image.open('picture.tif') I then try to convert it to RGBA with image.convert('RGBA') And

Solution 1:

image.convert doesn't change the mode of the image, it returns a new image with the new mode.

image = image.convert("RGBA")

From the documentation:

Unless otherwise stated, all methods return a new instance of the Image class, holding the resulting image.

Post a Comment for "Python Pil How Do I Convert 1 Bit Deep Images To Rgba?"