Cosworth431
Posts: 2
Joined: Mon Mar 03, 2014 6:15 pm

How can I display an image file in Python script?

Tue Jul 01, 2014 3:49 am

Hi, I am writing a program that should display an image file that had been taken earlier using PiCam and raspistill command.
The image is stored in /home/pi and the file name is face.jpg. I want it to show up for a few seconds so user can view the image without clicking anything. The image viewer should close after the time set. Any idea how can I so this? Thanks.

riklaunim
Posts: 265
Joined: Tue Apr 22, 2014 7:34 pm

Re: How can I display an image file in Python script?

Tue Jul 01, 2014 5:59 am

Simple PyQT4/5 application could do that using QLabel to display it and QTimer to close after some time.

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: How can I display an image file in Python script?

Tue Jul 01, 2014 6:58 am

or Python Tkinter and PIL. All are installed in the RPi
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How can I display an image file in Python script?

Tue Jul 01, 2014 7:08 am

KenT wrote:or Python Tkinter and PIL. All are installed in the RPi
Assuming that you are using a full stock install of Raspbian.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: How can I display an image file in Python script?

Tue Jul 01, 2014 11:13 pm

Side note: If you're using raspistill with python, maybe you'd be better served by http://picamera.readthedocs.org/ ?

Return to “Python”