Xiaolin Wu's line algorithm: Difference between revisions

Content added Content deleted
Line 2,734: Line 2,734:
"""
"""
compose_color = lambda bg, fg: int(round(alpha * fg + (1-alpha) * bg))
compose_color = lambda bg, fg: int(round(alpha * fg + (1-alpha) * bg))
c = compose_color(img.getpixel(xy), color, alpha)
c = compose_color(img.getpixel(xy), color)
img.putpixel(xy, c)
img.putpixel(xy, c)