extents test

This commit is contained in:
wiredfool 2013-09-30 21:57:19 -07:00
parent 5e897341c6
commit 2241f744d9

View File

@ -2,6 +2,19 @@ from tester import *
from PIL import Image
def test_extent():
im = lena('RGB')
(w,h) = im.size
transformed = im.transform(im.size, Image.EXTENT,
(0,0,
w/2,h/2), # ul -> lr
Image.BILINEAR)
scaled = im.resize((w*2, h*2), Image.BILINEAR).crop((0,0,w,h))
assert_image_similar(transformed, scaled, 10) # undone -- precision?
def test_quad():
# one simple quad transform, equivalent to scale & crop upper left quad
im = lena('RGB')