BUG: convert to greyscale errors

David Austin <[email protected]> Wed, 21 Mar 2012 11:33:48 +1100
Newsgroups gmane.comp.python.image
Message-ID <CAAqcurRQQnY9bB3urcJt+7oh42GfHDTd7cAb_u55VEujNDZnVQ@mail.gmail.com>
Hi all,

I've found an incorrect dependency upon neighbouring pixels in conversion
to
greyscale.  Running this simple script (against attached images):

import Image
im1 = Image.open('a.png')
im2 = Image.open('b.png')
pt = (301, 72)
print "Before", im1.getpixel(pt), im2.getpixel(pt)
im1 = im1.convert("P")
im2 = im2.convert("P")
print "After", im1.getpixel(pt), im2.getpixel(pt)

Gives:

Before (63, 73, 50) (63, 73, 50)
After 60 59

i.e. before conversion the RGB values are identical, after the greyscale
values are not.

Regards,
David

_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig
a.png (image/png, 193.5 KB) - not displayed
b.png (image/png, 193.4 KB) - not displayed