import os
import imageio
import numpy as np


def load_image(path):
    image = imageio.imread(path)
    return image


def save_image(path, image):
    x = np.array(image)
    imageio.imsave(path, x)


def save_numpy(path, array):
    np.savez(path, array=array)


def load_numpy(path):
    if os.path.isfile(path):
        data = np.load(path)
        return data['array']
    return None
