# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/badai.vision.ipynb (unless otherwise specified).

__all__ = ['arr2im', 'check_im', 'open_im']

# Cell
import PIL,io
# from utils import bytes_encode

# Cell
def arr2im(arr):
    "Convert array to PIL image"
    return PIL.Image.fromarray(arr,mode='RGB')

# Cell
def check_im(im,sz=256):
    "Check size of image is same as sz"
    return im if im.size==(sz,sz) else im.resize((sz,sz))

# Cell
def open_im(im):
    "Open image"
    return PIL.Image.open(im)