import pathlib
import base64


def read_image(filepath: pathlib.Path) -> str:
    """
    Read an image from a file.

    Args:
        filepath: Input image file path

    Returns:
        Image encoded in Base64
    """
    with open(filepath, "rb") as f:
        image_base64: str = base64.b64encode(f.read()).decode("utf-8")

    return image_base64