0

Hey i was wondering if there was any way to convert a 24 bit Bitmap into a 256 colour bitmap using PIL or something simillar. I found something like:

image = image.convert("P",color = Image.ADAPTIVE)

But i couldn't work out how to make that work.
So yeah any way that you know would be lovely.

Cheers

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Paul Thompson
0

This appears to work:

>>> im = Image.open("24bit test.bmp")
>>> im2 = im.convert("P")
>>> im2.save("256bit test.bmp")

The bit-depth of the output file is 8, so I assume that's what you were after?

Jeff

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.