def METHOD_NAME(image, flip_h, flip_v, transpose, display_range, saturated_value, use_numpy = False):
    """
    This converts a uint16 image into a uint8 image based on the display
    range. As a side effect it also returns the minimum and maximum values
    in the image.
    image - The original image as numpy.uint16 array.
    flip_h - Flip horizontal.
    flip_v - Flip vertical.
    transpose - Transpose image.
    display_range - [image value that equals 0, image value that equals 255].
    saturated_value - The value above which the image has saturated the camera.
    use_numpy - (optional) Use numpy even if the C library exists, defaults to False.
    return [numpy.uint8 image, original image minimum, original image maximum]
    """
    # Create a string specifying the operations that will be performed on the image.
    op_code = ""
    for op in [flip_h, flip_v, transpose]:
        if op:
            op_code += "1"
        else:
            op_code += "0"
    # Determine maximum in the rescaled image.
    if saturated_value is not None:
        max_range = 254.0
    else:
        saturated_value = 65536
        max_range = 255.0
    # Use C library for image manipulation, this will be faster and less memory intensive.
    if (image_manip is not None) and (not use_numpy):
        if transpose:
            rescaled = numpy.empty((image.shape[1], image.shape[0]), dtype = numpy.uint8)
        else:
            rescaled = numpy.empty((image.shape[0], image.shape[1]), dtype = numpy.uint8)
        image_min = ctypes.c_int(0)
        image_max = ctypes.c_int(0)
        # Get the appropriate C function based on the op_code.
        image_fn = getattr(image_manip, "rescaleImage" + op_code)
        image_fn(rescaled,
                 image,
                 image.shape[0],
                 image.shape[1],
                 display_range[0],
                 display_range[1],
                 saturated_value,
                 max_range,
                 ctypes.byref(image_min),
                 ctypes.byref(image_max))
        image_min = image_min.value
        image_max = image_max.value
    # Fall back to using numpy.
    else:
        image_min = numpy.min(image)
        image_max = numpy.max(image)
        if flip_h:
            image = numpy.fliplr(image)
        if flip_v:
            image = numpy.flipud(image)
        if transpose:
            image = numpy.transpose(image)
        rescaled = image.astype(numpy.float64)
        rescaled = max_range*(rescaled - display_range[0])/(display_range[1] - display_range[0])
        rescaled[(rescaled > max_range)] = max_range 
        rescaled[(rescaled < 0.0)] = 0.0
        # Check for saturated pixels
        if saturated_value is not None:
            rescaled[(image >= saturated_value)] = 255.0
        # Convert to contiguous uint8 array.
        rescaled += 0.5
        rescaled = rescaled.astype(numpy.uint8, order='C')
    return [rescaled, image_min, image_max]