def rotate_image(image, angle): rotated_image = ndimage.rotate(image, angle, mode='reflect', order=0, reshape=False) return rotated_image