Skip to content Skip to sidebar Skip to footer

Pillow Convert Png To 8bit Bitmap

i tried to convert 8bit PNGs to 8bit(256indexed palette) Bitmap image, but Pillow is keep vomiting crappy outcome. this is what i tried. image = Image.open(file) image = image.conv

Solution 1:

You can do it like this:

from PIL import Image

# Open image
image = Image.open('feather.png')

# Quantize to 256 colours using fast octree method
result = image.quantize(colors=256, method=2)

enter image description here


Post a Comment for "Pillow Convert Png To 8bit Bitmap"