[Image-SIG] rotate image with transparent background?

Douglas Bagnall douglas at paradise.net.nz
Thu Jan 18 02:55:08 CET 2007

hi Alec,

> I'm trying to rotate an image and have the expanded background be transparent.

The image you get from opening a JPG won't have an alpha channel. You
need to add it yourself with the .convert() method.

This ought to work:

im = Image.open("pic1.jpg").convert('RGBA')
im2 = im.rotate(32, expand = 1)

Douglas Bagnall

More information about the Image-SIG mailing list