From james_hu at hotmail.com Tue Nov 1 16:12:45 2005 From: james_hu at hotmail.com (James HU) Date: Tue, 01 Nov 2005 10:12:45 -0500 Subject: [Image-SIG] drag/move image from staticBitmap control Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20051101/453fe93d/attachment.htm From christoph.rackwitz at gmail.com Mon Nov 7 23:43:59 2005 From: christoph.rackwitz at gmail.com (Christoph Rackwitz) Date: Mon, 7 Nov 2005 23:43:59 +0100 Subject: [Image-SIG] PIL 1.1.5 "stub" discovered Message-ID: I was trying to .point() an "F"-type Image and got a traceback. A little digging around revealed this: >>> import Image >>> im = Image.new("F", (100, 100)) >>> im = im.point(lambda v: v) Traceback (most recent call last): File "", line 1, in ? File "C:\python\Lib\site-packages\PIL\Image.py", line 1035, in point scale, offset = _getscaleoffset(lut) File "C:\python\Lib\site-packages\PIL\Image.py", line 360, in _getscaleoffset (a, b, c) = data # simplified syntax ValueError: need more than 1 value to unpack >>> def dump(v, w): ... print repr(v); return w ... >>> im.point(lambda v: dump(v.data, v)) ['stub'] Traceback (most recent call last):... I just wanted to hand you back your reminder ;) From juguang at tll.org.sg Tue Nov 8 05:54:01 2005 From: juguang at tll.org.sg (Juguang XIAO) Date: Tue, 8 Nov 2005 12:54:01 +0800 Subject: [Image-SIG] Complication Problem: FREETYPE2 support not available Message-ID: <58DD63D3-33DE-4BC8-81F0-1D72BC31A6B4@tll.org.sg> Dear all, I am new to this list, so this question may sound silly. I am using Mac OS X 10.4.3, and my Python is Python 2.3.5 (#1, Mar 20 2005, 20:38:20) [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin I have updated my freetype2 by darwinports to libfreetype. 6.3.7.dylib, which I think it is freetype 2.1.9_1 And here is my modified setup.py, in which JPEG works after this file is changed like this. FREETYPE_ROOT = '/opt/local/lib/' JPEG_ROOT = '/opt/local/lib/' TIFF_ROOT = None ZLIB_ROOT = '/opt/local/lib/' TCL_ROOT = None Finally, I ran python setup.py build_ext -i --include-dirs=/opt/local/include -- library-dirs=/opt/local/lib But I still get the error, that is *** FREETYPE2 support not available Did I miss any critical step? Thanks for your enlightenment! Juguang From fredrik at pythonware.com Tue Nov 8 08:26:16 2005 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 8 Nov 2005 08:26:16 +0100 Subject: [Image-SIG] Complication Problem: FREETYPE2 support not available References: <58DD63D3-33DE-4BC8-81F0-1D72BC31A6B4@tll.org.sg> Message-ID: Juguang XIAO wrote: > I am new to this list, so this question may sound silly. > > I am using Mac OS X 10.4.3, and my Python is > > Python 2.3.5 (#1, Mar 20 2005, 20:38:20) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin > > I have updated my freetype2 by darwinports to libfreetype. > 6.3.7.dylib, which I think it is freetype 2.1.9_1 > > And here is my modified setup.py, in which JPEG works after this file > is changed like this. > > FREETYPE_ROOT = '/opt/local/lib/' are you sure the freetype include files are located under /opt/local/lib? try replacing that line with FREETYPE_ROOT = libinclude("/opt/local") (or use a prebuilt release for Mac OS X; the 10.3+ builds available here should work: http://pythonmac.org/packages/ ) From juguang at tll.org.sg Tue Nov 8 08:43:41 2005 From: juguang at tll.org.sg (Juguang XIAO) Date: Tue, 8 Nov 2005 15:43:41 +0800 Subject: [Image-SIG] Complication Problem: FREETYPE2 support not available In-Reply-To: References: <58DD63D3-33DE-4BC8-81F0-1D72BC31A6B4@tll.org.sg> Message-ID: <82B15631-8F89-4E1F-A44A-727A28997AE0@tll.org.sg> >> >> FREETYPE_ROOT = '/opt/local/lib/' > > are you sure the freetype include files are located under /opt/ > local/lib? > > try replacing that line with > > FREETYPE_ROOT = libinclude("/opt/local") OK. This works. Many thanks! :-) Juguang From fredrik at pythonware.com Tue Nov 8 13:05:12 2005 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 8 Nov 2005 13:05:12 +0100 Subject: [Image-SIG] PIL 1.1.5 "stub" discovered References: Message-ID: Christoph Rackwitz wrote: >I was trying to .point() an "F"-type Image and got a traceback. A > little digging around revealed this: > >>>> import Image >>>> im = Image.new("F", (100, 100)) >>>> im = im.point(lambda v: v) > Traceback (most recent call last): > File "", line 1, in ? > File "C:\python\Lib\site-packages\PIL\Image.py", line 1035, in point > scale, offset = _getscaleoffset(lut) > File "C:\python\Lib\site-packages\PIL\Image.py", line 360, in _getscaleoffset > (a, b, c) = data # simplified syntax > ValueError: need more than 1 value to unpack >>>> def dump(v, w): > ... print repr(v); return w > ... >>>> im.point(lambda v: dump(v.data, v)) > ['stub'] > Traceback (most recent call last):... > > I just wanted to hand you back your reminder ;) when used on floating point images, the point method requires a callable object that applies the following expression on its argument: argument * scale + offset the point method evaluates this expression once, using a special stub object that builds an expression descriptor. the method then uses a fast linear point transform on the image. your example shows that the stub object doesn't handle unsupported expression forms, but that's not very surprising ;-) From michele.petrazzo at unipex.it Tue Nov 8 13:44:05 2005 From: michele.petrazzo at unipex.it (Michele Petrazzo) Date: Tue, 08 Nov 2005 13:44:05 +0100 Subject: [Image-SIG] drag/move image from staticBitmap control In-Reply-To: References: Message-ID: <43709D95.1030908@unipex.it> James HU wrote: > Hi, all gurus, > > I have an application to show bitmap image on one wx.staticBitmap > control area, I can display part of the image, or the whole > image(detail is unclear), > > But I would like to use mouse to drag/move the image inside > thewx.staticBitmap control when only part image on the screen, just > like maps.google does, > > is it possible to do that? > Yes, but: like wxstaticBitmap doc say, is not a good idea to use that control to display an image, because it can have some platform-depended problem. You can use a wxPanel instead, bind the wx.EVT_PAINT event, and do there some work. > Any sample code or any idea or suggestion are appreciated! > Some time ago, on wx list I read that someone do the same and I download that file. I had looked for that message, but I can't find it, so I upload on my website that file here: www.unipex.it/vario/imgview.zip > BTW, this message posted on other lists as well, nobody reply. > > James I hope that this can help you, Michele From michele.petrazzo at unipex.it Tue Nov 8 16:12:21 2005 From: michele.petrazzo at unipex.it (Michele Petrazzo) Date: Tue, 08 Nov 2005 16:12:21 +0100 Subject: [Image-SIG] open tiff fil in wxImage directlye In-Reply-To: <90DEA7ED93F71A4580CEDF76A02682EA03ACC2@torexch.metrigenix.com> References: <90DEA7ED93F71A4580CEDF76A02682EA03ACC2@torexch.metrigenix.com> Message-ID: <4370C055.6040305@unipex.it> James Hu wrote: > Hi, all gurus, > > > > I need to display 16 bit tiff image on screen directly, but it > doesn't work, only black or gray background shown, (converting from > tiff to png first is not option though). I checked the document, > which says wxImage can open tif! This is not true, because I, with wxpython 2.6.x I can directly load a 8 bit tiff image into wxImage: img = wx.Image("tiff_img.tiff", wx.BITMAP_TYPE_ANY) > > Any info or help will be appreciated greatly!!! > I think that the problem is that wx can't load 16 bit images, The only solution that I found to work with 16 bit gray images are to use freeimagepy (I'm the developer) that is a freeimage wrapper. That library can load the 16 bit gray image and has other useful functions. freeimagepy.sf.net freeimage.sf.net Michele From michele.petrazzo at unipex.it Wed Nov 9 18:44:22 2005 From: michele.petrazzo at unipex.it (Michele Petrazzo) Date: Wed, 09 Nov 2005 18:44:22 +0100 Subject: [Image-SIG] drag/move image from staticBitmap control In-Reply-To: References: Message-ID: <43723576.7020000@unipex.it> James HU wrote: > Hi, Michele, > > I use your ImgView as scrollwindow embedded on my panel, which also > has some controls like checkbox, and some buttons. It looks like I > almost there, the image is there, I can see it on the small window in > panel! but the scroll on horizontal or vertical is not there. > > attached is my test codes, if you got time, is it possible to help me > a little more? > add this line: self.scrolledWindow1.Zoom(+0) after self.scrolledWindow1.SetImage('imgtest.jpg') and delete this line in imgview self.GetParent().SetStatusText( str(zoom_percent) + "%" ) and enjoy! P.s. You code didn't work because there are some problems at scrolledwindows1 definition. This seen to work: self.scrolledWindow1 = ImgView(parent=self, pos=wx.Point(256, 96), size=wx.Size(320,280)) P.s.2: Please use the default "channels" (mailing list), so other users can read and enjoy with this modifies/code > I really appreciate your help! > > James Bye, Michele From jerdonek at gmail.com Wed Nov 16 20:50:32 2005 From: jerdonek at gmail.com (Chris Jerdonek) Date: Wed, 16 Nov 2005 11:50:32 -0800 Subject: [Image-SIG] PIL and py2app Message-ID: <5c581cadcd9d1b1ebcf09547c10e0bfd@gmail.com> Does anyone know what might be causing this? I have a python program that uses some commands from the PIL module. PIL is installed on my Mac, and the program works fine when I run it from the command line. However, the PIL part of the program stops working when I run it as an stand-alone app generated by py2app. The error message I'm getting is below. Also, I checked and I can see that the ImageFont.pyc file in a subdirectory of the build directory that py2app created. Thanks for any help anybody can provide, Chris Traceback (most recent call last): File "/Users/chris/Desktop/ER/StoveTop/Old/dist/stovetop.app/Contents/ Resources/Python/stovetop.py", line 205, in Click item.Activate(frame, event) File "reports.pyc", line 326, in GenerateReport File "reports.pyc", line 154, in makePie File "graph.pyc", line 202, in __init__ File "PIL/ImageFont.pyc", line 202, in truetype File "PIL/ImageFont.pyc", line 121, in __init__ IOError: cannot open resource From fredrik at pythonware.com Wed Nov 16 20:55:56 2005 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 16 Nov 2005 20:55:56 +0100 Subject: [Image-SIG] Undocumented floating-point TIF support in PIL? References: Message-ID: W.T. Bridgman wrote: > The PIL documentation claims that TIFF files are supported for "1", > "L", "RGB", or "CMYK" data. > > I was examining the Tiff plug-in and did not find anything that > suggested "F" was unsupported so I tried writing and reading a simple > floating-point TIFF. It worked. > > Is this just a missing entry in the docs or does anyone know of > potential gotchas should I start using this new found capability? the documentation is outdated. in 1.1.5, the TIFF loader supports the following modes: "1" "CMYK" "F" "I" "I;16" "I;16S" "L" "LA" "LAB" "P" "PA" "RGB" "RGBA" "RGBX" "YCbCr" (for a complete list of what TIFF pixel layouts that PIL can read, see the OPEN_INFO mapping in the TiffImagePlugin). From kevin at cazabon.com Thu Nov 17 02:48:09 2005 From: kevin at cazabon.com (kevin@cazabon.com) Date: Thu, 17 Nov 2005 02:48:09 +0100 Subject: [Image-SIG] PIL and py2app References: <5c581cadcd9d1b1ebcf09547c10e0bfd@gmail.com> Message-ID: <000f01c5eb18$f6da95f0$2032a8c0@cem.creo.com> make sure to include the PNG image module maybe? ImageFont font files for PIL are PNG format. Kevin. ----- Original Message ----- From: "Chris Jerdonek" To: Sent: Wednesday, November 16, 2005 8:50 PM Subject: [Image-SIG] PIL and py2app > Does anyone know what might be causing this? > > I have a python program that uses some commands from the PIL module. > > PIL is installed on my Mac, and the program works fine when I run it > from the command line. However, the PIL part of the program stops > working when I run it as an stand-alone app generated by py2app. The > error message I'm getting is below. > > Also, I checked and I can see that the ImageFont.pyc file in a > subdirectory of the build directory that py2app created. > > Thanks for any help anybody can provide, > Chris > > > Traceback (most recent call last): > File > "/Users/chris/Desktop/ER/StoveTop/Old/dist/stovetop.app/Contents/ > Resources/Python/stovetop.py", line 205, in Click > item.Activate(frame, event) > File "reports.pyc", line 326, in GenerateReport > File "reports.pyc", line 154, in makePie > File "graph.pyc", line 202, in __init__ > File "PIL/ImageFont.pyc", line 202, in truetype > File "PIL/ImageFont.pyc", line 121, in __init__ > IOError: cannot open resource > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > From bob at redivi.com Thu Nov 17 06:16:01 2005 From: bob at redivi.com (Bob Ippolito) Date: Wed, 16 Nov 2005 21:16:01 -0800 Subject: [Image-SIG] PIL and py2app In-Reply-To: <000f01c5eb18$f6da95f0$2032a8c0@cem.creo.com> References: <5c581cadcd9d1b1ebcf09547c10e0bfd@gmail.com> <000f01c5eb18$f6da95f0$2032a8c0@cem.creo.com> Message-ID: py2app is smart enough to include all image plugins if it detects PIL is being used. The problem was that the application needed a font, and the font wasn't listed as a data file so it didn't make it into the application bundle. -bob On Nov 16, 2005, at 5:48 PM, wrote: > make sure to include the PNG image module maybe? ImageFont font > files for > PIL are PNG format. > > Kevin. > ----- Original Message ----- > From: "Chris Jerdonek" > To: > Sent: Wednesday, November 16, 2005 8:50 PM > Subject: [Image-SIG] PIL and py2app > > >> Does anyone know what might be causing this? >> >> I have a python program that uses some commands from the PIL module. >> >> PIL is installed on my Mac, and the program works fine when I run it >> from the command line. However, the PIL part of the program stops >> working when I run it as an stand-alone app generated by py2app. The >> error message I'm getting is below. >> >> Also, I checked and I can see that the ImageFont.pyc file in a >> subdirectory of the build directory that py2app created. >> >> Thanks for any help anybody can provide, >> Chris >> >> >> Traceback (most recent call last): >> File >> "/Users/chris/Desktop/ER/StoveTop/Old/dist/stovetop.app/Contents/ >> Resources/Python/stovetop.py", line 205, in Click >> item.Activate(frame, event) >> File "reports.pyc", line 326, in GenerateReport >> File "reports.pyc", line 154, in makePie >> File "graph.pyc", line 202, in __init__ >> File "PIL/ImageFont.pyc", line 202, in truetype >> File "PIL/ImageFont.pyc", line 121, in __init__ >> IOError: cannot open resource >> >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig >> >> > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig From fredrik at pythonware.com Thu Nov 17 13:58:52 2005 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 17 Nov 2005 13:58:52 +0100 Subject: [Image-SIG] PIL and py2app References: <5c581cadcd9d1b1ebcf09547c10e0bfd@gmail.com> <000f01c5eb18$f6da95f0$2032a8c0@cem.creo.com> Message-ID: kevin at cazabon.com wrote: > make sure to include the PNG image module maybe? ImageFont font files for > PIL are PNG format. note that the error is reported inside the truetype function. the error message isn't very helpful, but the real cause for this exception is (as Bob noted) that the _imagingft driver could not find the requested file. From jerdonek at gmail.com Thu Nov 17 17:18:27 2005 From: jerdonek at gmail.com (Chris Jerdonek) Date: Thu, 17 Nov 2005 08:18:27 -0800 Subject: [Image-SIG] PIL and py2app In-Reply-To: References: <5c581cadcd9d1b1ebcf09547c10e0bfd@gmail.com> <000f01c5eb18$f6da95f0$2032a8c0@cem.creo.com> Message-ID: On Nov 17, 2005, at 4:58 AM, Fredrik Lundh wrote: > note that the error is reported inside the truetype function. > > the error message isn't very helpful, but the real cause for this > exception is (as Bob > noted) that the _imagingft driver could not find the requested file. The reason this was tricky for me is that _imagingft is a binary file (or a stub to a binary rather, in Bob's words) as opposed to a python module. So there was no way for me to look inside to see what it was asking for. In the end, things were simpler than that. One of the arguments passed to the _imagingft method was the name of the file: "Vera.tff". Thanks Bob and everybody for the help, Chris From bob at redivi.com Thu Nov 17 17:46:12 2005 From: bob at redivi.com (Bob Ippolito) Date: Thu, 17 Nov 2005 08:46:12 -0800 Subject: [Image-SIG] PIL and py2app In-Reply-To: References: <5c581cadcd9d1b1ebcf09547c10e0bfd@gmail.com> <000f01c5eb18$f6da95f0$2032a8c0@cem.creo.com> Message-ID: On Nov 17, 2005, at 4:58 AM, Fredrik Lundh wrote: > kevin at cazabon.com wrote: > >> make sure to include the PNG image module maybe? ImageFont font >> files for >> PIL are PNG format. > > note that the error is reported inside the truetype function. > > the error message isn't very helpful, but the real cause for this > exception is (as Bob > noted) that the _imagingft driver could not find the requested file. It'd have been a lot easier to track down this particular issue if the IOError given was the same one you get when doing open (nonExistentFile).. not sure if that's reasonable or not, though. -bob From fredrik at pythonware.com Thu Nov 17 17:58:25 2005 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 17 Nov 2005 17:58:25 +0100 Subject: [Image-SIG] PIL and py2app References: <5c581cadcd9d1b1ebcf09547c10e0bfd@gmail.com><000f01c5eb18$f6da95f0$2032a8c0@cem.creo.com> Message-ID: Bob Ippolito wrote: > It'd have been a lot easier to track down this particular issue if > the IOError given was the same one you get when doing open > (nonExistentFile).. not sure if that's reasonable or not, though. the driver uses the error string returned by the underlying library. if not else, this incident provides that it might be a good idea to add a bit more information to the exception string (in this case, my code knows that I'm trying to open a given file, so it could at least mention that...) From dwyerwk at yahoo.com Fri Nov 18 03:03:39 2005 From: dwyerwk at yahoo.com (bill dwyer) Date: Thu, 17 Nov 2005 18:03:39 -0800 (PST) Subject: [Image-SIG] adpil dne! Message-ID: <20051118020339.86626.qmail@web30006.mail.mud.yahoo.com> hi, i have had no problems with the imaging install on my iBook, yet i keep getting "module adpil not found" when i run the demos. is there something special i have to do to get this to run on an iMac? i have built using setup.py install and copied all files to the site-packages folder. thanks for the help bill __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com From bob at redivi.com Fri Nov 18 03:22:47 2005 From: bob at redivi.com (Bob Ippolito) Date: Thu, 17 Nov 2005 18:22:47 -0800 Subject: [Image-SIG] adpil dne! In-Reply-To: <20051118020339.86626.qmail@web30006.mail.mud.yahoo.com> References: <20051118020339.86626.qmail@web30006.mail.mud.yahoo.com> Message-ID: <76C21541-1032-401D-98C5-BA61208A604B@redivi.com> On Nov 17, 2005, at 6:03 PM, bill dwyer wrote: > i have had no problems with the imaging install on my iBook, yet i > keep getting "module > adpil not found" when i run the demos. is there something special i > have to do to get > this to run on an iMac? i have built using setup.py install and > copied all files to the > site-packages folder. I've never even heard of adpil... it certainly doesn't ship with PIL whatever it is. -bob From dwyerwk at yahoo.com Fri Nov 18 03:56:08 2005 From: dwyerwk at yahoo.com (bill dwyer) Date: Thu, 17 Nov 2005 18:56:08 -0800 (PST) Subject: [Image-SIG] adpil dne! In-Reply-To: <76C21541-1032-401D-98C5-BA61208A604B@redivi.com> Message-ID: <20051118025608.91788.qmail@web30010.mail.mud.yahoo.com> sorry. it is part of pymorph. i was putting it in the wrong site-packages folder. thank you though --- Bob Ippolito wrote: > > On Nov 17, 2005, at 6:03 PM, bill dwyer wrote: > > > i have had no problems with the imaging install on my iBook, yet i > > keep getting "module > > adpil not found" when i run the demos. is there something special i > > have to do to get > > this to run on an iMac? i have built using setup.py install and > > copied all files to the > > site-packages folder. > > I've never even heard of adpil... it certainly doesn't ship with PIL > whatever it is. > > -bob > > __________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com From james_hu at hotmail.com Wed Nov 9 20:21:37 2005 From: james_hu at hotmail.com (James HU) Date: Wed, 09 Nov 2005 14:21:37 -0500 Subject: [Image-SIG] drag/move image from staticBitmap control In-Reply-To: <43723576.7020000@unipex.it> Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20051109/2f5f6c13/attachment.htm From james_hu at hotmail.com Wed Nov 9 23:42:56 2005 From: james_hu at hotmail.com (James HU) Date: Wed, 09 Nov 2005 17:42:56 -0500 Subject: [Image-SIG] drag/move image from staticBitmap control In-Reply-To: <43723576.7020000@unipex.it> Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20051109/0244caea/attachment.html From codecraig at gmail.com Mon Nov 14 16:24:35 2005 From: codecraig at gmail.com (Craig W) Date: Mon, 14 Nov 2005 10:24:35 -0500 Subject: [Image-SIG] PIL - screen capture Message-ID: I need to take a screen shot of the computer screen. I saw there is ImageGrab...however it only works on Windows. Is there a platform-independent ability to work around this? thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20051114/ea9da7c1/attachment.htm From tuvas at email.arizona.edu Wed Nov 23 18:09:09 2005 From: tuvas at email.arizona.edu (tuvas@email.arizona.edu) Date: Wed, 23 Nov 2005 10:09:09 -0700 Subject: [Image-SIG] Problem with PIL- libtiff.so Message-ID: <20051123100909.p84vi60cgc0ckc4k@www.email.arizona.edu> I have an error every time I try to show an image with PIL. I use a function something like this. pic=Image.open("test.jpg") pic.show() What happens is there's an error report as follows: xv: error while loading shared libraries: libtiff.so.3: cannot open shared object file: No such file or directory I know that PIL doesn't use the TIFF library, so, what's happening? I downloaded PIL directly from the website, and compiled it using Debian Linux. Any help is greatly appreciate! Thanks! From fredrik at pythonware.com Wed Nov 23 19:05:56 2005 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 23 Nov 2005 19:05:56 +0100 Subject: [Image-SIG] Problem with PIL- libtiff.so References: <20051123100909.p84vi60cgc0ckc4k@www.email.arizona.edu> Message-ID: tuvas at email.arizona.edu wrote: >I have an error every time I try to show an image with PIL. I use a function > something like this. > > pic=Image.open("test.jpg") > pic.show() > > What happens is there's an error report as follows: > xv: error while loading shared libraries: libtiff.so.3: cannot open shared > object file: No such file or directory it's easy to miss, but the error message comes from something that's identifying itself as "xv". the PIL documentation provides an additional clue: im.show() Displays an image. This method is mainly intended for debugging purposes. On Unix platforms, this method saves the image to a temporary PPM file, and calls the xv utility. so what's happening here isn't a problem with PIL itself; it's that your system has "xv" installed, but that your "xv" install is incomplete. how important is "show" for your work? if you cannot fix "xv", you could hack the Image.py module so it uses some other display utility. From zcwaa22 at ucl.ac.uk Sun Nov 27 22:54:02 2005 From: zcwaa22 at ucl.ac.uk (zcwaa22@ucl.ac.uk) Date: Sun, 27 Nov 2005 21:54:02 +0000 Subject: [Image-SIG] (no subject) Message-ID: <20051127215402.qrz6l4h2jkg0wkk8@www.webmail.ucl.ac.uk> Hi all, Ive been working on a project which uses blender, python and pil but due to restrictions in the current version of blender ive had to revert to an older version[2.25] this means older python and older pil. Im now using python 2.0 and PIL 1.1.1. ive been changing my scripts so that they work with these other versions but am runnig into problems with PIL, basically in my project blender takes a screenshot wihch PIL then prints on the default printer, this used to work fine but with the older PIL all i get is a page full of black where the image should be. If any of you who have any knowledge of old versions of PIL could help me that would be great, below is the script:(which i stole from the internet somewhere) ######################################################################## if own.printer == 1: import win32print import win32ui from PIL import Image, ImageWin import Rasterizer file_name = "test_a%04d.jpg" % own.printer_count #####filename = "anim%04d.tga" % obj.frame Rasterizer.makeScreenshot(file_name) # # Constants for GetDeviceCaps # # # HORZRES / VERTRES = printable area # HORZRES = 8 VERTRES = 10 # # LOGPIXELS = dots per inch # LOGPIXELSX = 88 LOGPIXELSY = 90 # # PHYSICALWIDTH/HEIGHT = total area # PHYSICALWIDTH = 110 PHYSICALHEIGHT = 111 # # PHYSICALOFFSETX/Y = left / top margin # PHYSICALOFFSETX = 112 PHYSICALOFFSETY = 113 printer_name = win32print.GetDefaultPrinter () ####file_name = "test.jpg" # # You can only write a Device-independent bitmap # directly to a Windows device context; therefore # we need (for ease) to use the Python Imaging # Library to manipulate the image. # # Create a device context from a named printer # and assess the printable size of the paper. # hDC = win32ui.CreateDC () hDC.CreatePrinterDC (printer_name) printable_area = hDC.GetDeviceCaps (HORZRES), hDC.GetDeviceCaps (VERTRES) printer_size = hDC.GetDeviceCaps (PHYSICALWIDTH), hDC.GetDeviceCaps (PHYSICALHEIGHT) printer_margins = hDC.GetDeviceCaps (PHYSICALOFFSETX), hDC.GetDeviceCaps (PHYSICALOFFSETY) # # Open the image, rotate it if it's wider than # it is high, and work out how much to multiply # each pixel by to get it as big as possible on # the page without distorting. # bmp = Image.open (file_name) if bmp.size[0] > bmp.size[1]: bmp = bmp.rotate (90) ratios = [1.0 * printable_area[0] / bmp.size[0], 1.0 * printable_area[1] / bmp.size[1]] scale = min (ratios) # # Start the print job, and draw the bitmap to # the printer device at the scaled size. # hDC.StartDoc (file_name) hDC.StartPage () dib = ImageWin.Dib (bmp) scaled_size = tuple ([scale * i for i in bmp.size]) x = (printer_size[0] - scaled_size[0]) / 2 y = (printer_size[1] - scaled_size[1]) / 2 dib.draw (hDC.GetHandleOutput (), (x, y) + scaled_size) hDC.EndPage () hDC.EndDoc () own.printer_count +=1 own.printer=0 ########################################################################## ive had to change dib = ImageWin.Dib (bmp) to dib = ImageWin.Dib (bmp,(1,1)) Any help would be greatly appreciated Thanks Will Hurt From kevin at cazabon.com Mon Nov 28 08:19:13 2005 From: kevin at cazabon.com (kevin@cazabon.com) Date: Mon, 28 Nov 2005 08:19:13 +0100 Subject: [Image-SIG] (no subject) References: <20051127215402.qrz6l4h2jkg0wkk8@www.webmail.ucl.ac.uk> Message-ID: <004201c5f3ec$094e8760$650aa8c0@duallie> You can always try my ImagePrintWin module for printing - it should be pretty easy to use, and has everything down to a printer setup GUI including print preview. Documentation is in the code, including the test at the very bottom. http://www.cazabon.com/python/downloads/ImagePrintWin.py (either as a code reference or for use in your program - I've used it successfully with older Python and PIL versions). Kevin. ----- Original Message ----- From: To: Sent: Sunday, November 27, 2005 10:54 PM Subject: [Image-SIG] (no subject) > Hi all, > > Ive been working on a project which uses blender, python and pil but due to > restrictions in the current version of blender ive had to revert to an older > version[2.25] this means older python and older pil. Im now using python 2.0 > and PIL 1.1.1. > ive been changing my scripts so that they work with these other versions but am > runnig into problems with PIL, basically in my project blender takes a > screenshot wihch PIL then prints on the default printer, this used to work fine > but with the older PIL all i get is a page full of black where the image should > be. If any of you who have any knowledge of old versions of PIL could help me > that would be great, below is the script:(which i stole from the internet > somewhere) > > ######################################################################## > if own.printer == 1: > import win32print > import win32ui > from PIL import Image, ImageWin > > import Rasterizer > file_name = "test_a%04d.jpg" % own.printer_count > #####filename = "anim%04d.tga" % obj.frame > Rasterizer.makeScreenshot(file_name) > > # > # Constants for GetDeviceCaps > # > # > # HORZRES / VERTRES = printable area > # > HORZRES = 8 > VERTRES = 10 > # > # LOGPIXELS = dots per inch > # > LOGPIXELSX = 88 > LOGPIXELSY = 90 > # > # PHYSICALWIDTH/HEIGHT = total area > # > PHYSICALWIDTH = 110 > PHYSICALHEIGHT = 111 > # > # PHYSICALOFFSETX/Y = left / top margin > # > PHYSICALOFFSETX = 112 > PHYSICALOFFSETY = 113 > > printer_name = win32print.GetDefaultPrinter () > ####file_name = "test.jpg" > > # > # You can only write a Device-independent bitmap > # directly to a Windows device context; therefore > # we need (for ease) to use the Python Imaging > # Library to manipulate the image. > # > # Create a device context from a named printer > # and assess the printable size of the paper. > # > hDC = win32ui.CreateDC () > hDC.CreatePrinterDC (printer_name) > printable_area = hDC.GetDeviceCaps (HORZRES), hDC.GetDeviceCaps (VERTRES) > printer_size = hDC.GetDeviceCaps (PHYSICALWIDTH), hDC.GetDeviceCaps > (PHYSICALHEIGHT) > printer_margins = hDC.GetDeviceCaps (PHYSICALOFFSETX), hDC.GetDeviceCaps > (PHYSICALOFFSETY) > > # > # Open the image, rotate it if it's wider than > # it is high, and work out how much to multiply > # each pixel by to get it as big as possible on > # the page without distorting. > # > bmp = Image.open (file_name) > if bmp.size[0] > bmp.size[1]: > bmp = bmp.rotate (90) > ratios = [1.0 * printable_area[0] / bmp.size[0], 1.0 * printable_area[1] / > bmp.size[1]] > scale = min (ratios) > > # > # Start the print job, and draw the bitmap to > # the printer device at the scaled size. > # > hDC.StartDoc (file_name) > hDC.StartPage () > > dib = ImageWin.Dib (bmp) > scaled_size = tuple ([scale * i for i in bmp.size]) > x = (printer_size[0] - scaled_size[0]) / 2 > y = (printer_size[1] - scaled_size[1]) / 2 > dib.draw (hDC.GetHandleOutput (), (x, y) + scaled_size) > > hDC.EndPage () > hDC.EndDoc () > > own.printer_count +=1 > own.printer=0 > > ########################################################################## > ive had to change > > dib = ImageWin.Dib (bmp) > > to > > dib = ImageWin.Dib (bmp,(1,1)) > > > Any help would be greatly appreciated > > Thanks > > Will Hurt > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > > From kevin at cazabon.com Mon Nov 28 08:13:05 2005 From: kevin at cazabon.com (kevin@cazabon.com) Date: Mon, 28 Nov 2005 08:13:05 +0100 Subject: [Image-SIG] (no subject) References: <20051127215402.qrz6l4h2jkg0wkk8@www.webmail.ucl.ac.uk> Message-ID: <003801c5f3eb$303019d0$650aa8c0@duallie> You can always try my ImagePrintWin module for printing - it should be pretty easy to use, and has everything down to a printer setup GUI including print preview. Documentation is in the code, including the test at the very bottom. http://www.cazabon.com/python/downloads/ImagePrintWin.py Kevin. ----- Original Message ----- From: To: Sent: Sunday, November 27, 2005 10:54 PM Subject: [Image-SIG] (no subject) > Hi all, > > Ive been working on a project which uses blender, python and pil but due to > restrictions in the current version of blender ive had to revert to an older > version[2.25] this means older python and older pil. Im now using python 2.0 > and PIL 1.1.1. > ive been changing my scripts so that they work with these other versions but am > runnig into problems with PIL, basically in my project blender takes a > screenshot wihch PIL then prints on the default printer, this used to work fine > but with the older PIL all i get is a page full of black where the image should > be. If any of you who have any knowledge of old versions of PIL could help me > that would be great, below is the script:(which i stole from the internet > somewhere) > > ######################################################################## > if own.printer == 1: > import win32print > import win32ui > from PIL import Image, ImageWin > > import Rasterizer > file_name = "test_a%04d.jpg" % own.printer_count > #####filename = "anim%04d.tga" % obj.frame > Rasterizer.makeScreenshot(file_name) > > # > # Constants for GetDeviceCaps > # > # > # HORZRES / VERTRES = printable area > # > HORZRES = 8 > VERTRES = 10 > # > # LOGPIXELS = dots per inch > # > LOGPIXELSX = 88 > LOGPIXELSY = 90 > # > # PHYSICALWIDTH/HEIGHT = total area > # > PHYSICALWIDTH = 110 > PHYSICALHEIGHT = 111 > # > # PHYSICALOFFSETX/Y = left / top margin > # > PHYSICALOFFSETX = 112 > PHYSICALOFFSETY = 113 > > printer_name = win32print.GetDefaultPrinter () > ####file_name = "test.jpg" > > # > # You can only write a Device-independent bitmap > # directly to a Windows device context; therefore > # we need (for ease) to use the Python Imaging > # Library to manipulate the image. > # > # Create a device context from a named printer > # and assess the printable size of the paper. > # > hDC = win32ui.CreateDC () > hDC.CreatePrinterDC (printer_name) > printable_area = hDC.GetDeviceCaps (HORZRES), hDC.GetDeviceCaps (VERTRES) > printer_size = hDC.GetDeviceCaps (PHYSICALWIDTH), hDC.GetDeviceCaps > (PHYSICALHEIGHT) > printer_margins = hDC.GetDeviceCaps (PHYSICALOFFSETX), hDC.GetDeviceCaps > (PHYSICALOFFSETY) > > # > # Open the image, rotate it if it's wider than > # it is high, and work out how much to multiply > # each pixel by to get it as big as possible on > # the page without distorting. > # > bmp = Image.open (file_name) > if bmp.size[0] > bmp.size[1]: > bmp = bmp.rotate (90) > ratios = [1.0 * printable_area[0] / bmp.size[0], 1.0 * printable_area[1] / > bmp.size[1]] > scale = min (ratios) > > # > # Start the print job, and draw the bitmap to > # the printer device at the scaled size. > # > hDC.StartDoc (file_name) > hDC.StartPage () > > dib = ImageWin.Dib (bmp) > scaled_size = tuple ([scale * i for i in bmp.size]) > x = (printer_size[0] - scaled_size[0]) / 2 > y = (printer_size[1] - scaled_size[1]) / 2 > dib.draw (hDC.GetHandleOutput (), (x, y) + scaled_size) > > hDC.EndPage () > hDC.EndDoc () > > own.printer_count +=1 > own.printer=0 > > ########################################################################## > ive had to change > > dib = ImageWin.Dib (bmp) > > to > > dib = ImageWin.Dib (bmp,(1,1)) > > > Any help would be greatly appreciated > > Thanks > > Will Hurt > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > > > From emmatata at hotmail.com Tue Nov 29 17:45:33 2005 From: emmatata at hotmail.com (MATATA EMMANUEL) Date: Tue, 29 Nov 2005 16:45:33 -0000 Subject: [Image-SIG] Python and ArcMap Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20051129/625177d2/attachment.html