[Image-SIG] perspective transform

Jeff Breidenbach jbreiden at parc.com
Wed Feb 16 22:39:41 CET 2005


PIL's Image Module already has support for affine transformations. 
Is there any interest in adding support for the perspective 
transformation as well? Something like:

===================

im.transform(size, PERSPECTIVE, data)

Applies a persepctive transform to the image, and places the result 
in a new image with the given size.

Data is a 8-tuple (a, b, c, d, e, f, g, h) which contains the 
coefficients for a perspective transform. For each pixel (x, y)
in the output image, the new value is taken from a position 
(a x + b y + c)/(g x + h y + 1), (d x + e y + f)/(g x + h y + 1) 
in the input image, rounded to nearest pixel.

This function can be used to change the 2D perspective of the 
original image.




More information about the Image-SIG mailing list