473,385 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Display of JPEG images from Python

I would like to display a JPEG image from Python on a Windows machine.
I Googled 'python jpeg display' and have not found what I am looking
for, which is code I can call directly and pass the image. I see the
PIL library lets me do all sorts of image manipulation, but is there a
convenient way to display results? I guess I could issue shell commands
to a graphics display package such as IrfanView, but I thought there
might be a cleaner method.

david lees
Jan 6 '06 #1
3 6241
Hi!

Example:

import Image
Image.open('Titi.jpg').show()


@-salutations

Michel Claveau

Jan 6 '06 #2
You can f.i. use wxPython (www.wxPython.org). Here is a compact and
ugly, but (almost) minimal, example of a python script that shows an
image file:

import wx
a = wx.PySimpleApp()
wximg = wx.Image('img.jpg',wx.BITMAP_TYPE_JPEG)
wxbmp=wximg.ConvertToBitmap()
f = wx.Frame(None, -1, "Show JPEG demo")
f.SetSize( wxbmp.GetSize() )
wx.StaticBitmap(f,-1,wxbmp,(0,0))
f.Show(True)
def callback(evt,a=a,f=f):
# Closes the window upon any keypress
f.Close()
a.ExitMainLoop()
wx.EVT_CHAR(f,callback)
a.MainLoop()

-svein

Jan 7 '06 #3
Svien and Michel,

Thanks for your help. Much appreciated.

David Lees
Jan 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Constantine Kakoushis | last post by:
Hi, I was previously running from my home test server (Suse 9.0) but have recently uploaded to my ISP. Since then (I think) images that have been resized on the server (resulting in .pjpeg...
6
by: Ron Brennan | last post by:
Good evening. An HTML problem maybe, but one that I think can be solved with JavaScript. I have a page which is supposed to display several small JPEG images using elements like: <image...
1
by: Mamatha | last post by:
Hi I am developing a small application to capture a record a video file through webcam in C#.NET. In this application i created a JPEG images for every slide,means every JPEG image was treated...
6
by: Olav Tollefsen | last post by:
I'm getting an array of bytes returned from a web service representing a jpeg image. How can I display this on an asp.net page? The Image control seems only to take an URL as a paremeter. Olav
3
by: Peter | last post by:
I have a problem which seems to come up from time to time but I can't find anything relevant in the archives. I have used PIL v1.1.5 with no problem on Windows for some time but now wish to put it...
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
3
by: den 2005 | last post by:
Hi everyone, Here is code working on..Trying to insert record with a column with Image or VarBinary datatype in sql database from a existing jpeg image file, then retrieve this image from...
0
by: Jack Wu | last post by:
Hi I've spent a good majority of my day trying to figure out how to have PIL 1.1.5 working on my OSX 10.3.9_PPC machine. I'm still stuck and I have not gotten anywhere. Could somebody please...
0
by: Daniel Nogradi | last post by:
Hi all, Last time I checked PIL was not able to apply lossless transformations to jpeg images so I've created Python bindings (or is it a wrapper? I never knew the difference :)) for the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.