Karsten Hiddemann schrieb:
Fredrik has written something about the performance on pixel access with
some timings here: http://effbot.org/zone/pil-pixel-access.htm
As that page also mentions, PIL images have the point method for doing
this kind of thing.
see
Gautham Narayan wrote:
I'm having trouble understanding the behaviour of Image.crop (PIL
1.1.6 w/ python 2.5.1) when the bbox is outside the limits of the
image. So something like,
b = a.crop(x1,y1,x2,y2)
with x1 and y1 0 say.
Sometimes I get a purely black border (which is good), sometimes I
Ned Batchelder wrote:
If your image is single-channel (mode L), then you can use the eval
function:
img = Image.open(onechannel.png)
# at each pixel, if it isn't zero, make it 255..
better = Image.eval(img, lambda p: 255 * (int(p != 0)))
better.save(bilevel.png)
if you want to