def crop_image(image, x1, y1, x2, y2):
    """
    Given an image an crop rectangle
    x1, y1, x2, y2, return the cropped image.


    >>> m = [[[0.0, 1.0, 1.0], [1.0, 0.0, 0.0]],
    ...      [[0.0, 1.0, 1.0], [1.0, 0.0, 0.0]]]
    >>> img = array_to_image(m)
    >>> crop_image(img, 0, 0, 1, 1) # doctest: +ELLIPSIS
    <PIL.Image.Image image mode=RGB size=1x1 at ...>
    """
    return image.crop((x1, y1, x2, y2))