Plotly unable to embed a logo or background image in plotly

Hey guys, I figured out how to implement local files. In the docs they mentioned that we can pass PIL image objects instead of links, however that doesn’t work but it gave me another option which is to use base64 encoding e.g. ‘data:image/png;base64,iVBORw0KGgoAAAANSU’

So all you have to do is open your file

with open("yourfile.ext", "rb") as image_file:
    encoded_string = base64.b64encode(image_file.read()).decode('utf-8')

and then as source pass: source=f’data:image/png;base64,{encoded_string}’ and it worked for me! Hope that helps people in the future who find this!

Note that I’m using Python version and not R but had the same problem.