I am wondering, is it possible to display images in python?
6 Answers
The easiest way is to use PIL and the Image.show method. This brings up an external viewer program on the image.

- 299,747
- 42
- 398
- 622
-
Windows users should also be aware of this bug and workaround: http://stackoverflow.com/questions/8932976/python-imaging-library-show-on-windows – Mark Ransom Nov 28 '12 at 21:50
Almost all GUI toolkits (wxWindows, pyQt, pyGTK, Tkinter) have Canvas or other-type widgets that allow you to draw an image.
The standard library way to draw an image is to use Tkinter's Canvas
widget.

- 75,757
- 21
- 156
- 151
The question needs more clearing up. Do you want to put the picture on a system display? Or on a window in a desktop app? Or render it to a http response?
Python can do all these things in different manners, but for people to explain it - you need to specify your question a bit more.

- 5,457
- 6
- 39
- 51
The easiest way is to use a web server I reckon. You can script a nice, simple server with bottle and turn out a UI with images.
It depends what you want to do. Python can do it all, but needs something to work with. There's pygame and stuff like that if you're just starting out.

- 3,025
- 24
- 36
Using wx.Python here is an example. The picture printed is 'bitmaps/image.jpg'. It prints on the panel using the wx.StaticBitmap() class. from Main import opj
def showPic(frame, nb, log):
jpg = wx.Image(opj('bitmaps/image.jpg'), wx.BITMAP_TYPE_JPEG).ConvertToBitmap()
panel = wx.Panel(nb, -1)
wx.StaticBitmap(panel, -1, jpg, (10, 10))
return panel

- 11
- 2
The various OpenCV bindings for Python also provide ways to display images (and videos). Might be a bit heavy if you just want to display an image.

- 310,957
- 84
- 592
- 636