Tkinter draw jpeg or png

Is it possible to draw a PNG or JPEG image to a tkinter.Canvas() without using any external packages, like PIL?

I would like to do something, like this:

canvas.create_image(x, y, image="some_png_image.png")

Or is it possible to convert the image to GIF, using only built-in packages?

Upvotes: 0

Views: 312

Answers (1)

Kexus
Kexus

Reputation: 659

According to the Tkinter documentation, the PhotoImage class can only load images from GIF and PGM files. To load an image of another type, or to convert the image to a GIF, you'll need an external package such as OpenCV or PIL.

Upvotes: 1

Related Questions