import openpyxl import PIL def main(): excel_file = './test_includeing_img.xlsx' wb = openpyxl.load_workbook(excel_file) for xlsx_img in wb['Sheet1']._images: #print( xlsx_img.path ) # sheet中の座標 print( xlsx_img.anchor._from.col, xlsx_img.anchor._from.row ) pil_img = PIL.Image.open( xlsx_img.ref ) pil_img = pil_img.resize( ( pil_img.width//2, pil_img.height//2 ) ) output_path = "./test_extract_img.png" pil_img.save(output_path) if __name__ == '__main__': main()