[Image-SIG] additional parameter for rotate API
jbreiden at parc.com
Tue Jan 18 01:43:14 CET 2005
I've appended the API for the PIL rotate function below. When
one rotates a rectangular image, there are always "gaps" that
need to be filled in. You know, the triangular areas that
were not part of the image before rotation.
For an RGB image, PIL currently fills in these gaps with black.
I'd like to see the fill color be programmable (or at least
have the ability to set it to white). What do people think?
This would require an extension to the API.
im.rotate(angle) => image
im.rotate(angle, filter) => image
Returns a copy of an image rotated the given number of degrees counter
clockwise around its centre.
The filter argument can be one of NEAREST (use nearest neighbour),
BILINEAR (linear interpolation in a 2x2 environment), or BICUBIC (cubic
spline interpolation in a 4x4 environment). If omitted, or if the image
has mode "1" or "P", it is set to NEAREST.
Jeff Breidenbach <jbreiden at parc.com>
Palo Alto Research Center (PARC)
More information about the Image-SIG