Skip to content

Commit

Permalink
local warp anti-alias. You have to think clearly!
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricporter committed Jul 14, 2012
1 parent e57b007 commit 5243eb5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions EffectLab/Effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,19 @@ def filter(self, img):
f = lambda x, y: (x, y)

nband = len(img.getpixel((0, 0)))
antialias = 1
antialias = 4
for x in range(width):
for y in range(height):
if sqrt((x - cx) ** 2 + (y - cy) ** 2) > r:
continue

found = 0
psum = (0, ) * nband
# new_img.putpixel((x, y), (128, 128, 128, 255))

for ai in range(antialias):
_x = x + ai
_x = x + ai / float(antialias)
for aj in range(antialias):
_y = y + aj
_y = y + aj / float(antialias)

u, v = self.warp(_x, _y, r, (cx, cy), (mx, my))
u = int(round(u))
Expand Down

0 comments on commit 5243eb5

Please sign in to comment.