def _src_from_img_obj(img_obj):
    """Base64 encodes image bytes for inclusion in an HTML img element"""
    for bundle in img_obj._repr_mimebundle_():
        for mimetype, b64value in bundle.items():
            if mimetype.startswith('image/'):
                return f'data:{mimetype};base64,{b64value}'