def overlay_pixel(src, dst):
    pixel = numpy.array([
        #RED
        ((src[3] * src[0] * dst[3])/255**2) +
        ((src[0] * (255 - dst[3]))/255    ) +
        ((dst[0] * dst[3] * (255 - src[3]))/255**2),
        #GREEN
        ((src[3] * src[1] * dst[3])/255**2) +
        ((src[1] * (255 - dst[3]))/255    ) +
        ((dst[1] * dst[3] * (255 - src[3]))/255**2),
        #BLUE
        ((src[3] * src[2] * dst[3])/255**2) +
        ((src[2] * (255 - dst[3]))/255    ) +
        ((dst[2] * dst[3] * (255 - src[3]))/255**2),
        #ALPHA
        (src[3] * dst[3]         )/255    + (src[3] * (255 - dst[3]))/255 + (dst[3] * (255 - src[3])/255)
        ],
        dtype=numpy.uint8)
    return pixel
dataset/ETHPy150Open aheadley/pynemap/pynemap.py/overlay_pixel/original