Python – How to fill Excel cell with image, using python
If you have ever dreamed that it will be possible to fill out an Excel cell with a picture, using Python, then you should probably reevaluate your dreams. Seriously, who dreams of something like that?

Without further dreaming, the code below will return a file named export.xlsx with my logo on it on cell B2:
import openpyxl
import requests
from PIL import Image
wb = openpyxl.Workbook()
ws = wb.worksheets[0]
url = 'https://www.vitoshacademy.com/wp-content/uploads/2013/07/cropped-VA-grey2.png'
my_logo = Image.open(requests.get(url, stream=True).raw)
img = openpyxl.drawing.image.Image(my_logo)
# img = openpyxl.drawing.image.Image('printing_a_picture.png')
ws.add_image(img, 'B2')
wb.save('export.xlsx')
print("ready")
Like this:

Abd if you want to upload the picture from your PC, then uncomment this line and run it again – img = openpyxl.drawing.image.Image(‘printing_a_picture.png’) .
That’s all folks!