Please write the details of your question here.
(Example) I am making a ●● system with PHP (CakePHP).
■■ The following error message occurred while implementing the function.
couldn't recognize data in image fileCorresponding source code
root = tkinter.Tk ()
root.title ("Madao Diagnostic App")
root.resizable (False, False)
canvas = tkinter.Canvas (root, width = 800, height = 600)
gazou = tkinter.PhotoImage (file = "a.png")
canvas.create_image (400,300, image = gazou)
What I tried
The image cannot be displayed with JPN
Converted from JPN format to PNG
Please describe here what you have tried for the problem.
I can't tell you well because I've just started, but please teach me.
Please provide more detailed information here.
Answer # 1
Combined with Pillow (the successor to PIL), you can view Jpeg images in tkinter.
import tkinter from PIL import Image, ImageTk root = tkinter.Tk () root.title ("Madao Diagnostic App") root.resizable (False, False) canvas = tkinter.Canvas (root, width = 800, height = 600) canvas.pack () image = Image.open ("a.jpg") gazou = ImageTk.PhotoImage (image) canvas.create_image (400, 300, image = gazou) root.mainloop ()
- python - i want to display an image with pysimplegui, but an error occurs
- python - about mnist image display
- python - i want to display a vector on the image
- python - about image display and position of main ()
- python - error in image binarization using cv2adaptivethreshold function
- about image display of python
- python - image display from the variable to which the file name is assigned
- error in python image reading iobytesio ()
- error display on python discord bot
- i want to display python data mining 0 without erasing it!
- [python3] i want to display the numerical list from excel vertically (line feed display) on the tkinter window
- how to save the image ocr result file in python
- python - i got an import error even though i did pip install
- c ++ - image switching display method
- about the cause of the error in python pdto_datetime
- python - watchdog is installed, but i get the error modulenotfounderror: no module named'watchdog'
- python - attributeerror:'series' object has no attribute'flags' error
- python - i want to create and save a graph, but i get an error
- python - i get a key error
- i want to resolve a syntax error in a python while statement
- python : How to place a widget /button /text PYSIMPLEGUI in the specified coordinates
- python : Error "Unicode String Expected Instaad Of Entry Instance"
- python : Error 'Entry' Object Is Not Callible
- python : How to call a function from one class being in another?
- python : How to make it work if after clicking on one of the buttons?
- python : How to change the Entry size in tkinter
- python : In the dialog box, create a button to copy to the buffer
- Working with windows in Python
- python : How can I cause a variable in the Thread3 () function () from the Main () function, which is in the Thread2 function ()
- Creating a Motion Animation diagonally in Python using Tkinter