Questions tagged [photoimage]
104 questions
0
votes
2 answers
Trying to display a whole image in tkinter
ok so school project
goal of this code piece is to display a 450x450 gif for 20sec
output only displays a section of the gif
photo = tkinter.PhotoImage(file = './Images/img1.gif')
root.geometry("450x450")
root.update()
img =…

Photonium
- 7
- 2
- 7
0
votes
1 answer
trying to achieve an automatic open -> close in tkinter
so i'm doing a project for school with tkinter
what i'm currently trying to do is display an image that is a 450x450px .gif
what it needs to do is
open > 20sec delay > close
here is the current code
photo = tkinter.PhotoImage(file =…

Photonium
- 7
- 2
- 7
0
votes
1 answer
How to keep antialiasing in python tk application icon?
This is what I do to assign an icon shown in 'Alt-Tab' list to my python script.
self.icon = tk.PhotoImage(file=iconpath)
self.root.tk.call('wm', 'iconphoto', self.root._w, self.icon)
But it only works with .gif, which can't handle…

Antony Hatchkins
- 31,947
- 10
- 111
- 111
-1
votes
2 answers
_tkinter.TclError: image ... doesn't exist
Can't find any not outdated answers, I'm creating a canvas and running a filepath through PhotoImage so I can create_image in the canvas, but I'm getting an error that says the image {path} does not exist, despite the image obviously existing…

Renni Stewart
- 33
- 5
-1
votes
1 answer
Tkinter not working on macos Mojave version 10.14.4
I am running a simple Tkinter example to load a window with an image. When the code is executed, a window is opened but of a very small size. When I resize the window, it's empty. The image is not loaded.
I am using Pycharm. I experienced the same…

Abin John Thomas
- 159
- 2
- 13
-1
votes
1 answer
Adding a different image for each button using tkinter
We are creating a Boggle game for school, and we want to make the interface as as nice as possible.
We created an icon for each letter and we want each button to have it's icon.
For some reason is doesnt work, and I can't figure out why - it only…

Enmar
- 1
-1
votes
1 answer
Can I assign a variable to an image made by a for loop in the loop?
I am creating a chinese checkers AI project, and I created the checkers using a for loop. What I want to ask is, is it possible to assign a variable to each checker I created with create_image with the for loop?
I use this code:
black = []
black =…

F. Zeng
- 85
- 1
- 2
- 11
-1
votes
1 answer
How does python support the display of images on canvas or label widgets?
The question is not if Python supports the display of images, but rather how it supports the display of images. By choice I am using Python 2.7, and this has Tkinter and Image libraries/modules installed. I don't have the pygame module, which seems…

Phume
- 55
- 11
-1
votes
1 answer
Tkinter PhotoImage background image not showing
I tried to make a image as background in a frame, the code is as follows,
from tkinter import *
class LoginFrame(Frame):
def __init__(self, parent):
#Frame.__init__(self, parent)
super(LoginFrame, self).__init__()
…

daiyue
- 7,196
- 25
- 82
- 149
-1
votes
1 answer
Python - Tkinter PhotoImage Image Not Found
I'm in the process of writing code for a blackjack game. All of the .gifs are in the .py file directory, and when referenced directly they work fine. However, when I use the line below tkinter is reporting this:
_tkinter.TclError: image…

Jonathan Morris
- 3
- 3
-1
votes
1 answer
Tkinter: Couldn't recognize data in image file
I have the following problem. I generate .GIF files using an external application.
To me the GIFs look fine, I can open them without problems.
However, using
photo = PhotoImage(file=screenshot_file)
…

Doc
- 345
- 4
- 17
-2
votes
1 answer
I am using PhotoImage in python to make a image, but it cannot find a image
I am creating a python board game, but i cant even put my board on my GUI!
I am using:
from tkinter import *
root = Tk()
panel = Label(root, image = "board.gif")
panel.pack(side = "bottom", fill = "both", expand = "yes")
root.mainloop()
But it…

F. Zeng
- 85
- 1
- 2
- 11
-2
votes
1 answer
Python- tkinter: Opening One Another image in another window?
Hello I am doing a job that I need (from a tkinter window containing an image) call another window that contains another imagem.I tried the following:
from tkinter import*
def abrir1():
b =Tk()
imagen = PhotoImage(file= "F2.png")
la =…

Bruno.
- 3
- 3
-3
votes
2 answers
PhotoImage GIF won't appear (noob friendly please)
Alright, so I want to make a gif display when a function has been called, but the gif will go invisible and not show up. I searched for possible answers but all of them mention "create a reference to (insert code here)" and I don't really get it…

Scarm
- 1
- 1