diff --git a/TestEffectLab.py b/TestEffectLab.py index 7ad83aa..6f8cc0a 100755 --- a/TestEffectLab.py +++ b/TestEffectLab.py @@ -5,9 +5,10 @@ # import os +from math import sqrt, sin, cos, tan, atan2 from EffectLab.Effect import * -def make_origin_and_new(img, effect): +def merge_origin_and_new(img, effect): '''Merge origin and new Image processed by function effect in one Image ''' width, height = img.size @@ -20,7 +21,6 @@ def make_origin_and_new(img, effect): out.paste(old, (0, 0)) out.paste(img, (width, 0)) draw = ImageDraw.Draw(out) - draw.line((width, 0, width, height), (255, 0, 0, 255)) return out @@ -29,7 +29,7 @@ def make_origin_and_new(img, effect): effects = [GlobalWaveEffect(), RadianSqrtEffect(), RadianFormulaEffect(lambda r, phi: (r ** 1.5 * math.cos(r), phi)), - LensWarpEffect(lambda x, y: (math.sin(x * math.pi / 2), math.sin(y * math.pi / 2))), + LensWarpEffect(lambda x, y: (sin(x * math.pi / 2), sin(y * math.pi / 2))), LensWarpEffect(lambda x, y: (sign(x) * x ** 2, sign(y) * y ** 2)), RadianFormulaEffect(lambda r, phi: (r ** 2, phi), 4), LocalWarpEffect((130, 120), (130, 50), 100), @@ -41,6 +41,6 @@ def make_origin_and_new(img, effect): img = Image.new("RGBA", (300, 300), (255, 255, 255, 255)) for index, effect in enumerate(effects): - make_origin_and_new(img, effect).save('%d.jpg' % index, quality=90) + merge_origin_and_new(img, effect).save('%d.jpg' % index, quality=90) print '.', print 'done'