473,835 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Easy image rendering?

Can someone tell me what's the absolute easiest way of putting an image
on to the screen in Python without just opening it up in an
application? What's the simplest way to just put something up on the
screen?

Aug 9 '06 #1
7 1818
On Wed, 09 Aug 2006 16:27:50 -0700, ja*******@gmail .com wrote:
Can someone tell me what's the absolute easiest way of putting an image
on to the screen in Python without just opening it up in an
application? What's the simplest way to just put something up on the
screen?
If you are using PIL you could use im.show(); but all that does is saving
the image data to a file and opening that file in an external
application (xv on UNIX). At least you don't have to do it yourself.
Aug 10 '06 #2

jayCan someone tell me what's the absolute easiest way of putting an
jayimage on to the screen in Python without just opening it up in an
jayapplication? What's the simplest way to just put something up on
jaythe screen?

Maybe something like this:

import PIL.Image
img = PIL.Image.open( open("someimage .png", "rb"))
img.show()

Skip
Aug 10 '06 #3

import PIL.Image
img = PIL.Image.open( open("someimage .png", "rb"))
img.show()

No need for the extra open. Sorry...

Skip

Aug 10 '06 #4
No good. No external applications. What else is there? Worst case
scenario, what's the easiest way to do GUI?

Pontus Ekberg wrote:
On Wed, 09 Aug 2006 16:27:50 -0700, ja*******@gmail .com wrote:
Can someone tell me what's the absolute easiest way of putting an image
on to the screen in Python without just opening it up in an
application? What's the simplest way to just put something up on the
screen?

If you are using PIL you could use im.show(); but all that does is saving
the image data to a file and opening that file in an external
application (xv on UNIX). At least you don't have to do it yourself.
Aug 10 '06 #5
>If you are using PIL you could use im.show(); but all that does is
saving the image data to a file and opening that file in an external
application (xv on UNIX). At least you don't have to do it yourself.
jayNo good. No external applications. What else is there? Worst case
jayscenario, what's the easiest way to do GUI?

You can still use PIL. Just feed the result to Tkinter. Check out the
ImageTk module that's part of PIL:

http://www.pythonware.com/library/pi...ok/imagetk.htm

Check this thread for some hints from Fredrik Lundh on combining PIL and
Tkinter:

http://mail.python.org/pipermail/pyt...ly/007379.html

I'm sure when he gets up in Europe he'll be able to provide some more useful
pointers.

Skip

Aug 10 '06 #6
I think that you've put me on the right track, but my eventual goal is
to be able to put the pictures on the screen with a full-screen
interface. Not in a visible window, with just the picture and then a
black backdrop for it.

sk**@pobox.com wrote:
If you are using PIL you could use im.show(); but all that does is
>saving the image data to a file and opening that file in an external
>application (xv on UNIX). At least you don't have to do it yourself.

jayNo good. No external applications. What else is there? Worst case
jayscenario, what's the easiest way to do GUI?

You can still use PIL. Just feed the result to Tkinter. Check out the
ImageTk module that's part of PIL:

http://www.pythonware.com/library/pi...ok/imagetk.htm

Check this thread for some hints from Fredrik Lundh on combining PIL and
Tkinter:

http://mail.python.org/pipermail/pyt...ly/007379.html

I'm sure when he gets up in Europe he'll be able to provide some more useful
pointers.

Skip
Aug 10 '06 #7
ja*******@gmail .com:
my eventual goal is
to be able to put the pictures on the screen with a full-screen
interface. Not in a visible window, with just the picture and then a
black backdrop for it.
Pygame (plus PIL if you need) can do that, Pygame manages full screens
too.

Bye,
bearophile

Aug 10 '06 #8

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

Similar topics

1
2049
by: Mark McKay | last post by:
I'm developing an application that draws on several disk based images to create a composite image. I've noticed that my rendering time goes up as I load more images into memory. However, this seems to be due to the number of distinct images rather than the number of bytes they take up, since when I combine them into a single image in photoshop my rendering time goes down again. Since an image is essentially a 1D array of bytes in...
6
3050
by: bissatch | last post by:
Hi, I am currently writing a news admin system. I would like to add the ability to add images to each article. What I have always done in the past is uploaded (using a form) the image to a folder on the server and then in the database table that I INSERT the news article, I'll store the path of the uploaded image. To me this seems a bad idea as if the image paths were changed on the
2
1442
by: Jeronimo Bertran | last post by:
I have an aspx page that shows a complex image with several objects that are sensitive to mouseover events. The information about the objects in the image is obtained from a database and complex calculations are performed for each object to determine the position within the image. To render the image I created an aspx page that uses the following code to render the image: Response.ContentType = "image/jpeg";...
2
2593
by: Jeronimo Bertran | last post by:
Hello, I am using a rendering aspx page to display a database image on an Image control. When the database record is retrieved, I am saving the bitmap to a session variable for the rendering aspx to load. Here is the code on the rendering page: CODE FOR ImageForm.aspx private void Page_Load(object sender, System.EventArgs e)
11
4217
by: Tomek Toczyski | last post by:
What is the best way to attach a caption to an image in xhtml? I can attach a caption to a table by a "<caption>" tag but I would like to do sth similar to an image. How to do it in a natural way? -tt.
6
1997
by: nichughes | last post by:
Hello all, A question relating to http://www.entrust-systems.net/ Just for a change I have run into a problem that seems to be OS specific rather than browser specific - the box image that is acting as a faux border for the main text block shows nasty image effects on the outside when using either Firefox or Konqueror on Suse Linux. This image is set to resize with the browser window (and hence the text) and this seems to be what...
1
1577
by: ApexData | last post by:
Hello I am in the early stages of my project development, and want to make sure that I am approaching the issue of image display correctly. Access2000. I have one table and a bound single form. I would like to have one image (.bmp 100k or .jpg 30k) displayed on the form for each record. I am using an ImageFrame to display my image, and the following code to link the image to the display:
0
1181
by: hardieca | last post by:
Hi, I would like to create an adapter for the image web control to cure a pet peeve of mine. Currently, if I write out: <asp:Image ImageUrl="myPic.jpg" AlternateText="Some text" runat="server" /> the html that is emitted is:
4
4742
by: Ryan Knopp | last post by:
This is an update from a previous post, I just simplified the code. It seems that I can't get the image map to work with IE7. The page is located here http://www.theknopps.com/test.html and the source below. I can't seem to figure out why IE7 won't recognize the image map. Thanks for your help Ryan
0
9808
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9652
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10561
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10235
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7766
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5638
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5804
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3995
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.