PIL Problem: New image is all black on Unix?

Kevin Cazabon kcazabon at home.com
Sun Feb 20 20:06:46 EST 2000


A type "1" image is a monotone black/white image.  Instead of using 0xFF and
0x00 as colors, try using 0 and 1 (on and off).

Kevin Cazabon.

"Thomas & Jennifer Thompson" <tmt1630 at cs.rit.edu> wrote in message
news:38B02B50.482854B7 at cs.rit.edu...
> I'm running Python v1.5.2 on Solaris 5.7 with PIL v1.0.  When I create a
>
> new image of type "1' and size xy with either white or black pixels,
> the image comes out black in both cases. So:
>
> >>> import Image
> >>> raw=Image.new("1", (20,20), 0xFF)
>
> returns a black image which I expect to be white.
>
> >>> import Image
> >>> raw=Image.new("1", (20,20), 0x00)
>
> returns a black image which I do expect.
>
> Further, if I try to set a pixel to white using
> ImageDraw.setink(color) and ImageDraw.point(xy),
> it still comes out black.
>
> These commands work fine on my Win95 system (Python
> v1.5.1, PIL v1.0b1). Is this a known bug with PIL and Solaris
> and will using the latest version of PIL for Solaris fix this?
> Or did I miss something somewhere?
>
> Any help would be greatly appreciated!
>
> Tom Thompson
>





More information about the Python-list mailing list