identify x,y coordinates in an image
sholden at holdenweb.com
Wed Nov 7 23:35:15 CET 2001
"Cliff Wells" <logiplexsoftware at earthlink.net> wrote ...
[ ... ]
> Since I've been asked for them so often (three times and counting!), I'll
> post them to the list. I believe I got the original code from Piddle...
> been a while, so I'm not too sure. And yes, those are tab-indentations
> you four-spacers!).
Well, in my case that should now read "were tab-indentations": see what OE
does to your beautiful tabs -- completely lost, along with the sense of the
> def PILToWX(image):
> "convert a PIL image to a wxImage"
> if (image.mode != 'RGB'):
> image = image.convert('RGB')
> imageData = image.tostring('raw', 'RGB')
> imageWx = wxEmptyImage(image.size, image.size)
> return imageWx
> def WXToPIL(image, mode = 'RGBA'):
> "convert a wxImage to a PIL RGBA image"
> imageData = image.GetData()
> size = (image.GetWidth(), image.GetHeight())
> imagePIL = Image.fromstring('RGB', size, imageData)
> if mode != 'RGB':
> imagePIL = imagePIL.convert(mode)
> return imagePIL
don't-know-a-mail-tool-that-drops-leading-spaces-ly y'rs - steve
More information about the Python-list