import pathlib
import io


def read_file(path: pathlib.Path) -> bytes:
    """
    Function to read in an image file and return the bytes

    :param path: File path
    """
    with io.open(path, "rb") as file:
        content = file.read()
    return content