python – Trying to add bmp image to ScrolledText widget and it says it does not exist (Tkinter)

I’m trying to add a program icon I got as a bmp image to a ScrolledText widget. I’m getting this error:

_tkinter.TclError: image “<PIL.BmpImagePlugin.BmpImageFile image mode=RGB size=32×32 at 0x19B2FA18EB0>” doesn’t exist

Here’s the relevant code:

def get_icon(exe):
    ico_x = win32api.GetSystemMetrics(win32con.SM_CXICON)
    ico_y = win32api.GetSystemMetrics(win32con.SM_CYICON)

    large, small = win32gui.ExtractIconEx(exe, 0)
    win32gui.DestroyIcon(small(0))

    hdc = win32ui.CreateDCFromHandle(win32gui.GetDC(0))
    hbmp = win32ui.CreateBitmap()
    hbmp.CreateCompatibleBitmap(hdc, ico_x, ico_y)
    hdc = hdc.CreateCompatibleDC()

    hdc.SelectObject(hbmp)
    hdc.DrawIcon((0, 0), large(0))

    hbmp.SaveBitmapFile(hdc, 'icon.bmp')

    img = Image.open("icon.bmp")

    return img

text_area = ScrolledText(root,
                            width = 40,
                            height = 40,
                            font = ("Times New Roman",
                                    25))

img = get_icon("C:Program FilesBraveSoftwareBrave-BrowserApplicationBrave.exe")
text_area.image_create("current", padx=5, pady=5, image=ImageTk.PhotoImage(img))
text_area.place(relx=0.2, rely=0.1, relwidth=0.5, relheight=0.5, anchor='s')

Any ideas?