Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-12 Thread Guy K. Kloss
On Sun, 12 Apr 2009 06:09:52 Wayne Watson wrote: > import PIL > import PIL.Image as Image > > img=Image.open('white dragon.png') > > (By the way, is "import Image" depreciated? it should be.) There's no value in importing a module and renaming it to the same name. Your second import statement sho

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-12 Thread Wayne Watson
Title: Signature.html I thought I posted the solution, from Tkinter import * import Image, ImageTk import tkFileDialog Maybe as part of another thread. I've found it quite easy to put things in the wrong place. That has to do with sometimes not changing my usual format from html to plain text,

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-11 Thread Wayne Watson
I thought I posted the solution, from Tkinter import * import Image, ImageTk import tkFileDialog Maybe as part of another thread. I've found it quite easy to put things in the wrong place. That has to do with sometimes not changing my usual format from html to plain text, which hangs

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-09 Thread Christopher Barker
Fredrik Lundh wrote: The Tkinter module contains a "Image" class, so doing the "import *" thing after all other imports will stomp out the Import module. Either fix all uses of PIL to use fully qualified names (replace "import Image" with "import PIL.Image", "Image.open" with "PIL.Image.open" etc

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-08 Thread Fredrik Lundh
The Tkinter module contains a "Image" class, so doing the "import *" thing after all other imports will stomp out the Import module. Either fix all uses of PIL to use fully qualified names (replace "import Image" with "import PIL.Image", "Image.open" with "PIL.Image.open" etc), or, easier, move the

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-08 Thread Wayne Watson
Still a problem. import PIL import Image from Tkinter import * ... cnv.pack(expand=1,fill=BOTH) data.cnv=cnv img=Image.open('jupa9810.jpg') # some image you have. data.img=ImageTk.PhotoImage(img) produces: Traceback (most recent call last): File "C:\Sandia_Meteors\Sentinel_Dev

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-08 Thread Fredrik Lundh
On Wed, Apr 8, 2009 at 5:55 PM, Edward Cannon wrote: > Add the line > from Tkinter import Lost an asterisk there, I think: from Tkinter import * > > > > On Apr 7, 2009, at 10:21 PM, Wayne Watson > wrote: > >> This looks good, but there's a slight problem. It looks right, but I get >> this

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-08 Thread Edward Cannon
Add the line from Tkinter import On Apr 7, 2009, at 10:21 PM, Wayne Watson wrote: This looks good, but there's a slight problem. It looks right, but I get this when I try to run it: Traceback (most recent call last): File "C:/Sandia_Meteors/Sentinel_Development/Development_Sentuser- Ut

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-07 Thread Wayne Watson
This looks good, but there's a slight problem. It looks right, but I get this when I try to run it: Traceback (most recent call last): File "C:/Sandia_Meteors/Sentinel_Development/Development_Sentuser-Utilities/Playground/fun-move_object.py", line 42, in root=Tk() NameError: name 'Tk' is

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-07 Thread Howard Lightstone
Here is a *dumb* example of what I think you want. It can be elaborated with crosshairs, ring sizing, etc. import PIL import Image import ImageTk class data: startx=0 starty=0 def startmotioncallback(event): data.startx=event.x data.starty=event.y def motioncallback(event

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image

2009-04-07 Thread Laura & Edward Cannon
I do this using a callback from Tkinter, (and do the calculations in PIL) but you could get the callbacks from any windowing system you cared to use. On Tue, Apr 7, 2009 at 11:25 AM, Wayne Watson wrote: > Are you doing this purely with PIL or some toolkit? I would use a callback > that each time

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image

2009-04-07 Thread Wayne Watson
Are you doing this purely with PIL or some toolkit? I would use a callback that each time the mouse moves you move the image. What about rubber lines, stretching, for an to resize an object like a box? Laura & Edward Cannon wrote: I have had great success "moving" items across images by keepin

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-07 Thread Wayne Watson
Christopher Barker wrote: Wayne Watson wrote: Drawing on top of an image doesn't seem like it's going to help much if I want the user to move the circle-crosshair with his mouse. I think we need a little more detail about what you need here: Is the cross-hair there for the user to indicate th

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-07 Thread Christopher Barker
Wayne Watson wrote: Drawing on top of an image doesn't seem like it's going to help much if I want the user to move the circle-crosshair with his mouse. I think we need a little more detail about what you need here: Is the cross-hair there for the user to indicate the location of something wh

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image

2009-04-07 Thread Wayne Watson
BTW, the solution here is: mask = im.point(lambda i: 255 if i >= 255 else 0) Wayne Watson wrote: Consider this program that I pulled off the web and was posted in 1999. It purports to illustrate how one might produce a transparency. #!/usr/bin/python # see http://mail.python.org/pipermai

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image

2009-04-07 Thread Wayne Watson
Digging around hasn't been very successful; however, with your suggestion above to look for images and drawing in Wiki-land may pay off. Drawing on top of an image doesn't seem like it's going to help much if I want the user to move the circle-crosshair with his mouse. In some ways this is ki

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image (txt)

2009-04-06 Thread Wayne Watson
(I see I missed shifting my post to text, so it is hung up with the moderator. This is in text format.) Digging around hasn't been very successful; however, with your suggestion above to look for images and drawing in Wiki-land may pay off. Drawing on top of an image doesn't seem like it

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image

2009-04-06 Thread Christopher Barker
Wayne Watson wrote: So far I've used Python with Tkinter, and a touch of PIL. I'm pretty bound by Tkinter, since I'm modifying a program that used it quite a bit for the GUI ability rather than analysis of images with IP (image processing). OK, then dig around in the Tk docs and examples you

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image

2009-04-06 Thread Wayne Watson
Consider this program that I pulled off the web and was posted in 1999. It purports to illustrate how one might produce a transparency. #!/usr/bin/python # see http://mail.python.org/pipermail/python-list/1999-May/003388.html from Tkinter import * import Image, ImageTk import tkFil

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image

2009-04-05 Thread Wayne Watson
So far I've used Python with Tkinter, and a touch of PIL. I'm pretty bound by Tkinter, since I'm modifying a program that used it quite a bit for the GUI ability rather than analysis of images with IP (image processing). Christopher Barker wrote: Wayne Watson wrote: I would like to create

Re: [Image-SIG] Creating a Transparent Image and Placing it Over Another Image

2009-04-05 Thread Christopher Barker
Wayne Watson wrote: I would like to create a transparent image with a circle on it and a crosshair at the center of the circle, then place it on top of the first (real) image (produced by the h/w). I have no trouble drawing on the real image, but I'd like use this transparency idea here. Th