[Image-SIG] ImageChops.logical_and not working?

Fredrik Lundh fredrik at pythonware.com
Sat Sep 10 16:43:37 CEST 2005


Michael Hoffman wrote:

> Hello. Using PIL 1.1.5, I am trying to do logical ands on bitmap
> images using ImageChops.logical_and. I seem to always get completely
> black images instead, however.

hmm.  this works just fine on windows...

are you running this on unix?

the operations do work, but logical_and sets the output bytes to 1
instead of 255, and the ImagingSavePPM function that's used by the
"show" method on Unix cheats and saves mode "1" images as "PGM"
images without normalizing the values.  that's not very smart.

if you convert the images to mode "L" on the way out, they should look
right.

I'll fix this (both the operator and the save method) in 1.1.6.

</F> 





More information about the Image-SIG mailing list