I'm building a GUI app in python with Tkinter and I'm using the Pillow module to add images. I just moved on to a new MacBook Pro with a better screen resolution than my previous laptop and noticed the resolution of the images on the GUI is very bad. Even if the original PNG file quality is okay.
Here is my code:
from tkinter import Tk, Frame, Label
from PIL import Image, ImageTk
root = Tk()
global_frame = Frame(root, border=10)
global_frame.grid()
img = Image.open("/Users/marinnagy/Documents/image.png")
img_tk = ImageTk.PhotoImage(img)
Label(global_frame, image=img_tk).pack()
Label(global_frame, text="I am a label").pack()
root.mainloop()
And here is the result with a 70x15px image:
I tried to use a bigger image (700x150px) and downscale it by adding img = img.resize((70, 15)) just after opening the image file. I also tried to add the Image.LANCZOS option but the result is the same, if not worst:
Do you know what's wrong and how I can display a good quality image in tkinter on macOS? Maybe a specific file format or another way to open the file?
EDIT:
I saw a similar issue where the whole window resolution (image, label, button...) is low on macOS. This problem can be fixed by adding NSHighResolutionCapable parameter to the info.plist file. I checked but didn't find any similar thing for the image rendering, maybe that can help.

