Xiaolin Wu's line algorithm: Difference between revisions

(self bugfix of bugfix)
Line 2,733:
Use alpha for blending. alpha=1 means a completely opaque foreground.
"""
compose_color = lambda bg, fg: int(np.round(alpha * fg + (1-alpha) * bg))
c = compose_color(img.getpixel(xy), color, alpha)
img.putpixel(xy, c)
Anonymous user