mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Added mesh transform test
This commit is contained in:
parent
41b1021ffe
commit
5e897341c6
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user