def open(fp, mode="r"):
    "Open an image file, without loading the raster data"

    if mode != "r":
        raise ValueError("bad mode")

    if isStringType(fp):
        import __builtin__
        filename = fp
        fp = __builtin__.open(fp, "rb")
    else:
        filename = ""

    prefix = fp.read(16)

    preinit()

    for i in ID:
        try:
            factory, accept = OPEN[i]
            if not accept or accept(prefix):
                fp.seek(0)
                return factory(fp, filename)
        except (SyntaxError, IndexError, __HOLE__):
            pass

    if init():

        for i in ID:
            try:
                factory, accept = OPEN[i]
                if not accept or accept(prefix):
                    fp.seek(0)
                    return factory(fp, filename)
            except (SyntaxError, IndexError, TypeError):
                pass

    raise IOError("cannot identify image file")

#
# Image processing.

##
# Creates a new image by interpolating between two input images, using
# a constant alpha.
#
# <pre>
#    out = image1 * (1.0 - alpha) + image2 * alpha
# </pre>
#
# @param im1 The first image.
# @param im2 The second image.  Must have the same mode and size as
#    the first image.
# @param alpha The interpolation alpha factor.  If alpha is 0.0, a
#    copy of the first image is returned. If alpha is 1.0, a copy of
#    the second image is returned. There are no restrictions on the
#    alpha value. If necessary, the result is clipped to fit into
#    the allowed output range.
# @return An Image object.
dataset/ETHPy150Open kleientertainment/ds_mod_tools/pkg/win32/Python27/Lib/site-packages/PIL/Image.py/open