def union(f1, f2, *args):
    """
    y = union(f1, f2, f3=None, f4=None, f5=None, ...)

    Union of images.

    `union` creates the image `y` by taking the pixelwise maximum
    between the images given. When the images are binary images,
    y represents the union of them.

    Parameters
    ----------
    f1 : Gray-scale (uint8 or uint16) or binary image.
    f2 : Gray-scale (uint8 or uint16) or binary image. Or constant
    args : Gray-scale (uint8 or uint16) or binary images.

    Returns
    -------
    y : Image
    """
    """
        - Examples
            #
            #   example 1
            #
            f=to_uint8([255, 255,  0,  10,   0, 255, 250])
            print 'f=',f
            g=to_uint8([  0,  40, 80, 140, 250,  10,  30])
            print 'g=',g
            print union(f, g)
            print union(f, 255)
            #
            #   example 2
            #
            a = readgray('form-ok.tif')
            b = readgray('form-1.tif')
            c = union(a,b)
            show(a)
            show(b)
            show(c)
            #
            #   example 3
            #
            d = readgray('danaus.tif')
            e = (d < 80)
            f = union(d,gray(e))
            show(d)
            show(e)
            show(f)
            #
            #   example 4
            #
            g = readgray('tplayer1.tif')
            h = readgray('tplayer2.tif')
            i = readgray('tplayer3.tif')
            j = union(g,h,i)
            show(g)
            show(h)
            show(i)
            show(j)
    """
    from numpy import maximum
    y = maximum(f1, f2)
    for f in args:
        y = maximum(y, f)
    return y.astype(f1.dtype)
