Quad Perspective Transformation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kamilche

    #1

    Quad Perspective Transformation

    I have a need to tile a bitmap across an arbitrary quadrilateral, and
    apply perspective to it.
    The Python Imaging Library (PIL) has an undocumented function that
    might work, but I can't figure out how to make it work. You're
    supposed to pass it 8 parameters, a b c d e f g h .

    What I want is to take a rectangular texture map and 'flop it down on
    the floor' - pinch in the left and right with perspective, and squash
    down the top with perspective. I've modified those 8 parameters and
    examined the results, but that hasn't brought me any closer to my
    goal.

    The PIL function is this:

    im2 = im.transform(im .size, Image.PERSPECTI VE, (1, 0, 0, 0, 1, -100,
    0, .001), Image.BILINEAR)

    Here's hoping someone can shed some light on this function!

  • Gabriel Genellina

    #2
    Re: Quad Perspective Transformation

    En Thu, 01 Feb 2007 13:46:37 -0300, Kamilche <klachemin@comc ast.net>
    escribió:
    I have a need to tile a bitmap across an arbitrary quadrilateral, and
    apply perspective to it.
    The Python Imaging Library (PIL) has an undocumented function that
    might work, but I can't figure out how to make it work. You're
    supposed to pass it 8 parameters, a b c d e f g h .
    I don't know exactly how it's implemented, but the usual perspective
    transformation matrix has exactly 8 non zero parameters. Any text on
    computer graphics should cover it. My first hit on Google:


    --
    Gabriel Genellina

    Comment

    Working...