Added mesh transform test

This commit is contained in:
wiredfool 2013-09-30 21:21:53 -07:00
parent 41b1021ffe
commit 5e897341c6

View File

@ -2,4 +2,15 @@ from tester import *
from PIL import Image
success()
def test_quad():
# one simple quad transform, equivalent to scale & crop upper left quad
im = lena('RGB')
(w,h) = im.size
transformed = im.transform(im.size, Image.QUAD,
(0,0,0,h/2,
w/2,h/2,w/2,0), # ul -> ccw around quad
Image.BILINEAR)
scaled = im.resize((w*2, h*2), Image.BILINEAR).crop((0,0,w,h))
assert_image_equal(transformed, scaled, 10)