PIL breaks when using image.Open on a CTkButton #2717
Answered
by
dipeshSam
Sonic3Modder
asked this question in
Q&A
-
so im making a game launcher and this line: causes this error _tkinter.TclError: image "<PIL.PngImagePlugin.PngImageFile image mode=RGBA size=16x16 at 0x2715507D1F0>" doesn't exist |
Beta Was this translation helpful? Give feedback.
Answered by
dipeshSam
Apr 28, 2025
Replies: 2 comments 1 reply
-
also the image is 16x16 and is between I and t (in I think) |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Sonic3Modder ...
my_image = Image.open("images/play-fill.png")
my_icon = customtkinter.CTkImage(my_image, size=(16, 16))
GameStartButton = customtkinter.CTkButton(root, text="Start Game", image=my_icon)
... |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Sonic3Modder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Sonic3Modder
You need to use
CTkImage
. Try the following: