def crop_center(img, new_shape):
    """
    Crop an image equally on each size to create the new_shape
        Args:
            img (numpy array): 2D array to crop
            new_shape: desired shape of the return
        Returns:
            numpy array: array cropped according to shape
    """
    ul = ((img.shape[0]-new_shape[0])/2, (img.shape[1]-new_shape[1])/2)
    br = (ul[0]+new_shape[0], ul[1]+new_shape[1])
    return img[ul[0]:br[0], ul[1]:br[1]]