Christopher Schmidt wrote:
> When using image.transform, (EXTENT mode) it is
possible to select an area
> which contains pixels outside the image:
>
> out = im.transform((0,100), Image.EXTENT, (-50, -50,
50, 50))
>
> Is there a way to make these pixels transparent, or set
their color in
> some way?
there's no direct way to do this in the current version of
PIL, but you can get
the effect you're after by doing things in three steps:
# transform the main image
main = im.transform(size, mode, params)
# create a mask
mask = Image.new("L", im.size,
255).transform(size, mode, params)
# paste the image onto an output image using the mask
out = Image.new(mode, size, background)
out.paste(main, mask)
</F>
_______________________________________________
Image-SIG maillist - Image-SIG python.org
htt
p://mail.python.org/mailman/listinfo/image-sig
|