From David.Bear at asu.edu Tue Aug 1 01:42:51 2006 From: David.Bear at asu.edu (David Bear) Date: Mon, 31 Jul 2006 16:42:51 -0700 Subject: [Image-SIG] pil not finding libraries Message-ID: <20060731234251.GF8831@asu.edu> I am attempting to build pil1-5 and it is not finding the libraries. /installs/web/Imaging-1.1.5> /work/webenv/bin/python setup.py build_ext -i running build_ext -------------------------------------------------------------------- PIL 1.1.5 BUILD SUMMARY -------------------------------------------------------------------- version 1.1.5 platform linux2 2.4.2 (#4, Jul 27 2006, 14:34:30) [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] -------------------------------------------------------------------- *** TKINTER support not available *** JPEG support not available --- ZLIB (PNG/ZIP) support ok *** FREETYPE2 support not available Yet, I do have jpeg libraries installed rpm -qa | grep jpeg jpeg-6b-738 libjpeg-32bit-9.3-7 libjpeg-6.2.0-738 Any way to make sure pil finds these? I am using python 2.4.2 that I built from source myself. I am on suse linux 9.3. -- David Bear phone: 602-496-0424 fax: 602-496-0955 College of Public Programs/ASU University Center Rm 622 411 N Central Phoenix, AZ 85007-0685 "Beware the IP portfolio, everyone will be suspect of trespassing" From David.Bear at asu.edu Tue Aug 1 03:07:12 2006 From: David.Bear at asu.edu (David Bear) Date: Mon, 31 Jul 2006 18:07:12 -0700 Subject: [Image-SIG] not finding libraries Message-ID: <20060801010712.GI8831@asu.edu> I am attempting to build pil1-5 and it is not finding the libraries. /installs/web/Imaging-1.1.5> /work/webenv/bin/python setup.py build_ext -i running build_ext -------------------------------------------------------------------- PIL 1.1.5 BUILD SUMMARY -------------------------------------------------------------------- version 1.1.5 platform linux2 2.4.2 (#4, Jul 27 2006, 14:34:30) [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] -------------------------------------------------------------------- *** TKINTER support not available *** JPEG support not available --- ZLIB (PNG/ZIP) support ok *** FREETYPE2 support not available Yet, I do have jpeg libraries installed rpm -qa | grep jpeg jpeg-6b-738 libjpeg-32bit-9.3-7 libjpeg-6.2.0-738 Any way to make sure pil finds these? -- David Bear phone: 602-496-0424 fax: 602-496-0955 College of Public Programs/ASU University Center Rm 622 411 N Central Phoenix, AZ 85007-0685 "Beware the IP portfolio, everyone will be suspect of trespassing" From David.Bear at asu.edu Tue Aug 1 03:19:35 2006 From: David.Bear at asu.edu (David Bear) Date: Mon, 31 Jul 2006 18:19:35 -0700 Subject: [Image-SIG] not finding libraries In-Reply-To: <1f1ad621f7617cc062e35d2e2633d180@cogdon.org> References: <20060801010712.GI8831@asu.edu> <1f1ad621f7617cc062e35d2e2633d180@cogdon.org> Message-ID: <20060801011935.GJ8831@asu.edu> On Mon, Jul 31, 2006 at 06:10:25PM -0700, Chris Cogdon wrote: > > On Jul 31, 2006, at 18:07, David Bear wrote: > > >I am attempting to build pil1-5 and it is not finding the libraries. > > > >/installs/web/Imaging-1.1.5> /work/webenv/bin/python setup.py > >build_ext -i > >running build_ext > >-------------------------------------------------------------------- > >PIL 1.1.5 BUILD SUMMARY > >-------------------------------------------------------------------- > >version 1.1.5 > >platform linux2 2.4.2 (#4, Jul 27 2006, 14:34:30) > > [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] > >-------------------------------------------------------------------- > >*** TKINTER support not available > >*** JPEG support not available > >--- ZLIB (PNG/ZIP) support ok > >*** FREETYPE2 support not available > > > >Yet, I do have jpeg libraries installed > > > >rpm -qa | grep jpeg > >jpeg-6b-738 > >libjpeg-32bit-9.3-7 > >libjpeg-6.2.0-738 > > > >Any way to make sure pil finds these? > > You need to install the -devel sub-packages. This is generally true > when you're "compiling against" these libraries, and not just using > them. sub-packages? are these components of libjpeg rpms listed? -- David Bear phone: 602-496-0424 fax: 602-496-0955 College of Public Programs/ASU University Center Rm 622 411 N Central Phoenix, AZ 85007-0685 "Beware the IP portfolio, everyone will be suspect of trespassing" From chris at cogdon.org Tue Aug 1 03:10:25 2006 From: chris at cogdon.org (Chris Cogdon) Date: Mon, 31 Jul 2006 18:10:25 -0700 Subject: [Image-SIG] not finding libraries In-Reply-To: <20060801010712.GI8831@asu.edu> References: <20060801010712.GI8831@asu.edu> Message-ID: <1f1ad621f7617cc062e35d2e2633d180@cogdon.org> On Jul 31, 2006, at 18:07, David Bear wrote: > I am attempting to build pil1-5 and it is not finding the libraries. > > /installs/web/Imaging-1.1.5> /work/webenv/bin/python setup.py > build_ext -i > running build_ext > -------------------------------------------------------------------- > PIL 1.1.5 BUILD SUMMARY > -------------------------------------------------------------------- > version 1.1.5 > platform linux2 2.4.2 (#4, Jul 27 2006, 14:34:30) > [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] > -------------------------------------------------------------------- > *** TKINTER support not available > *** JPEG support not available > --- ZLIB (PNG/ZIP) support ok > *** FREETYPE2 support not available > > Yet, I do have jpeg libraries installed > > rpm -qa | grep jpeg > jpeg-6b-738 > libjpeg-32bit-9.3-7 > libjpeg-6.2.0-738 > > Any way to make sure pil finds these? You need to install the -devel sub-packages. This is generally true when you're "compiling against" these libraries, and not just using them. -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From jwt at onjapan.net Tue Aug 1 13:45:04 2006 From: jwt at onjapan.net (Jim Tittsler) Date: Tue, 1 Aug 2006 20:45:04 +0900 Subject: [Image-SIG] not finding libraries In-Reply-To: <20060801011935.GJ8831@asu.edu> References: <20060801010712.GI8831@asu.edu> <1f1ad621f7617cc062e35d2e2633d180@cogdon.org> <20060801011935.GJ8831@asu.edu> Message-ID: <1C696F52-5C9D-4346-B11C-875A0B96897D@onjapan.net> On Aug 1, 2006, at 10:19, David Bear wrote: > On Mon, Jul 31, 2006 at 06:10:25PM -0700, Chris Cogdon wrote: >> >> On Jul 31, 2006, at 18:07, David Bear wrote: >> >>> I am attempting to build pil1-5 and it is not finding the libraries. >>> >>> /installs/web/Imaging-1.1.5> /work/webenv/bin/python setup.py >>> build_ext -i >>> running build_ext >>> [...] >>> Yet, I do have jpeg libraries installed >>> >>> rpm -qa | grep jpeg >>> jpeg-6b-738 >>> libjpeg-32bit-9.3-7 >>> libjpeg-6.2.0-738 >>> >>> Any way to make sure pil finds these? >> >> You need to install the -devel sub-packages. This is generally true >> when you're "compiling against" these libraries, and not just using >> them. > > sub-packages? are these components of libjpeg rpms listed? Additional packages, with the headers (and often shared object files) for the associated package. For example for libjpeg-x.y.z, install the libjpeg-devel-x.y.z package. -- Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 Python Starship http://Starship.Python.net/crew/jwt/ Mailman IRC irc://irc.freenode.net/#mailman From David.Bear at asu.edu Wed Aug 2 03:12:56 2006 From: David.Bear at asu.edu (David Bear) Date: Tue, 1 Aug 2006 18:12:56 -0700 Subject: [Image-SIG] not finding libraries In-Reply-To: <1C696F52-5C9D-4346-B11C-875A0B96897D@onjapan.net> References: <20060801010712.GI8831@asu.edu> <1f1ad621f7617cc062e35d2e2633d180@cogdon.org> <20060801011935.GJ8831@asu.edu> <1C696F52-5C9D-4346-B11C-875A0B96897D@onjapan.net> Message-ID: <20060802011256.GL8831@asu.edu> On Tue, Aug 01, 2006 at 08:45:04PM +0900, Jim Tittsler wrote: > > On Aug 1, 2006, at 10:19, David Bear wrote: > > > On Mon, Jul 31, 2006 at 06:10:25PM -0700, Chris Cogdon wrote: > >> > >> On Jul 31, 2006, at 18:07, David Bear wrote: > >> > >>> I am attempting to build pil1-5 and it is not finding the libraries. > >>> > >>> /installs/web/Imaging-1.1.5> /work/webenv/bin/python setup.py > >>> build_ext -i > >>> running build_ext > >>> [...] > >>> Yet, I do have jpeg libraries installed > >>> > >>> rpm -qa | grep jpeg > >>> jpeg-6b-738 > >>> libjpeg-32bit-9.3-7 > >>> libjpeg-6.2.0-738 > >>> > >>> Any way to make sure pil finds these? > >> > >> You need to install the -devel sub-packages. This is generally true > >> when you're "compiling against" these libraries, and not just using > >> them. > > > > sub-packages? are these components of libjpeg rpms listed? > > Additional packages, with the headers (and often shared object files) > for the associated package. For example for libjpeg-x.y.z, install > the libjpeg-devel-x.y.z package. thanks for the infor. I went back and loaded all the devel rpms that I could find dealing with jpeg and freetype. Here is what I get now: PIL 1.1.5 BUILD SUMMARY -------------------------------------------------------------------- version 1.1.5 platform linux2 2.4.2 (#5, Aug 1 2006, 17:25:34) [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] -------------------------------------------------------------------- *** TKINTER support not available --- JPEG support ok --- ZLIB (PNG/ZIP) support ok --- FREETYPE2 support ok -------------------------------------------------------------------- To add a missing option, make sure you have the required library, and set the corresponding ROOT variable in the setup.py script. To check the build, run the selftest.py script. So, PIL is finding what it needs in the setup script. However, running the test gives me : python selftest.py ***************************************************************** Failure in example: _info(Image.open("Images/lena.jpg")) from line #24 of selftest.testimage Exception raised: Traceback (most recent call last): File "./doctest.py", line 499, in _run_examples_inner exec compile(source, "", "single") in globs File "", line 1, in ? File "./selftest.py", line 21, in _info im.load() File "PIL/ImageFile.py", line 180, in load d = Image._getdecoder(self.mode, d, a, self.decoderconfig) File "PIL/Image.py", line 328, in _getdecoder raise IOError("decoder %s not available" % decoder_name) IOError: decoder jpeg not available 1 items had failures: 1 of 55 in selftest.testimage ***Test Failed*** 1 failures. *** 1 tests of 55 failed. is it that 'lena.jpg' is not found, ir is a decoder elsewhere not found? > > > -- > Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 > Python Starship http://Starship.Python.net/crew/jwt/ > Mailman IRC irc://irc.freenode.net/#mailman > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig -- David Bear phone: 602-496-0424 fax: 602-496-0955 College of Public Programs/ASU University Center Rm 622 411 N Central Phoenix, AZ 85007-0685 "Beware the IP portfolio, everyone will be suspect of trespassing" From jwt at onjapan.net Wed Aug 2 05:31:20 2006 From: jwt at onjapan.net (Jim Tittsler) Date: Wed, 2 Aug 2006 12:31:20 +0900 Subject: [Image-SIG] not finding libraries In-Reply-To: <20060802011256.GL8831@asu.edu> References: <20060801010712.GI8831@asu.edu> <1f1ad621f7617cc062e35d2e2633d180@cogdon.org> <20060801011935.GJ8831@asu.edu> <1C696F52-5C9D-4346-B11C-875A0B96897D@onjapan.net> <20060802011256.GL8831@asu.edu> Message-ID: On Aug 2, 2006, at 10:12, David Bear wrote: > PIL 1.1.5 BUILD SUMMARY > -------------------------------------------------------------------- > version 1.1.5 > platform linux2 2.4.2 (#5, Aug 1 2006, 17:25:34) > [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] > -------------------------------------------------------------------- > *** TKINTER support not available I don't think it is relevant to your problem, but if you do want tkinter support, install the tk-devel RPM. > is it that 'lena.jpg' is not found, ir is a decoder elsewhere not > found? It looks like it is the decoder that is not found. I just tried the 'build' and 'selftest.py' steps on an FC5 machine and all the tests passed. My only guess is that you have a _imag*.so around from an earlier attempt when you didn't have the JPEG encoder. Jim P.S. Fedora Core 5 even packages PIL as python-imaging. I don't suppose your distribution does as well? -- Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 Python Starship http://Starship.Python.net/crew/jwt/ Mailman IRC irc://irc.freenode.net/#mailman From djmuhlestein at gmail.com Wed Aug 2 19:26:25 2006 From: djmuhlestein at gmail.com (Dennis Muhlestein) Date: Wed, 2 Aug 2006 11:26:25 -0600 Subject: [Image-SIG] Is there a PIL convert to Java ? Perhaps an interface to Java ? In-Reply-To: References: Message-ID: On 7/27/06, Andreas Schmidt wrote: > Hi, > > I would like to use the power of PIL in Java. My favorite solution would be > a 100% convertion of the PIL Python and C-Code to Java. I guess this doesn't > exist ? I didn't find anything with google. > How difficult would it be to do a conversion of the Code to Java ? > > Is there perhaps an interface with which I could use it in Java ? Java already has a pretty significant drawing api in the java.awt package. The 2d and 3d interfaces in combination with the javax.imageio package can probably do everything pil can do. Another option would be to use jython. -Dennis From David.Bear at asu.edu Thu Aug 3 23:27:04 2006 From: David.Bear at asu.edu (David Bear) Date: Thu, 3 Aug 2006 14:27:04 -0700 Subject: [Image-SIG] not finding libraries In-Reply-To: References: <20060801010712.GI8831@asu.edu> <1f1ad621f7617cc062e35d2e2633d180@cogdon.org> <20060801011935.GJ8831@asu.edu> <1C696F52-5C9D-4346-B11C-875A0B96897D@onjapan.net> <20060802011256.GL8831@asu.edu> Message-ID: <20060803212704.GG11291@asu.edu> Since this is a Suse 9.3 distro AND it has the python 2.4 and PIL rpms installed for that -- I'm wondering if the pil configurator is finding something there. Since I installed a separate python for a particular zope that I needed, something must be getting confused. what specific .so modules does the pil installer look for? Is there some way I can tell it to ignore _image*.so files that existed for the packaged version of python? On Wed, Aug 02, 2006 at 12:31:20PM +0900, Jim Tittsler wrote: > > On Aug 2, 2006, at 10:12, David Bear wrote: > > PIL 1.1.5 BUILD SUMMARY > > -------------------------------------------------------------------- > > version 1.1.5 > > platform linux2 2.4.2 (#5, Aug 1 2006, 17:25:34) > > [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] > > -------------------------------------------------------------------- > > *** TKINTER support not available > > I don't think it is relevant to your problem, but if you do want > tkinter support, install the tk-devel RPM. > > > is it that 'lena.jpg' is not found, ir is a decoder elsewhere not > > found? > > It looks like it is the decoder that is not found. I just tried the > 'build' and 'selftest.py' steps on an FC5 machine and all the tests > passed. My only guess is that you have a _imag*.so around from an > earlier attempt when you didn't have the JPEG encoder. > > Jim > > P.S. Fedora Core 5 even packages PIL as python-imaging. I don't > suppose your distribution does as well? > > -- > Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 > Python Starship http://Starship.Python.net/crew/jwt/ > Mailman IRC irc://irc.freenode.net/#mailman > > > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig -- David Bear phone: 602-496-0424 fax: 602-496-0955 College of Public Programs/ASU University Center Rm 622 411 N Central Phoenix, AZ 85007-0685 "Beware the IP portfolio, everyone will be suspect of trespassing" From chris at cogdon.org Thu Aug 3 23:31:39 2006 From: chris at cogdon.org (Chris Cogdon) Date: Thu, 3 Aug 2006 14:31:39 -0700 Subject: [Image-SIG] not finding libraries In-Reply-To: <20060803212704.GG11291@asu.edu> References: <20060801010712.GI8831@asu.edu> <1f1ad621f7617cc062e35d2e2633d180@cogdon.org> <20060801011935.GJ8831@asu.edu> <1C696F52-5C9D-4346-B11C-875A0B96897D@onjapan.net> <20060802011256.GL8831@asu.edu> <20060803212704.GG11291@asu.edu> Message-ID: <219ca7faf19b5a4b77b3bf79eb640700@cogdon.org> On Aug 3, 2006, at 14:27, David Bear wrote: > Since this is a Suse 9.3 distro AND it has the python 2.4 and PIL rpms > installed for that -- I'm wondering if the pil configurator is finding > something there. > > Since I installed a separate python for a particular zope that I > needed, something must be getting confused. > > what specific .so modules does the pil installer look for? Is there > some way I can tell it to ignore _image*.so files that existed for the > packaged version of python? To throw a somewhat uneducated opinion in, it's likely not looking for .so files or at least JUST the .so files, but include files, since it needs those to compile against them. -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From David.Bear at asu.edu Thu Aug 3 23:40:59 2006 From: David.Bear at asu.edu (David Bear) Date: Thu, 3 Aug 2006 14:40:59 -0700 Subject: [Image-SIG] not finding libraries In-Reply-To: <219ca7faf19b5a4b77b3bf79eb640700@cogdon.org> References: <20060801010712.GI8831@asu.edu> <1f1ad621f7617cc062e35d2e2633d180@cogdon.org> <20060801011935.GJ8831@asu.edu> <1C696F52-5C9D-4346-B11C-875A0B96897D@onjapan.net> <20060802011256.GL8831@asu.edu> <20060803212704.GG11291@asu.edu> <219ca7faf19b5a4b77b3bf79eb640700@cogdon.org> Message-ID: <20060803214059.GH11291@asu.edu> On Thu, Aug 03, 2006 at 02:31:39PM -0700, Chris Cogdon wrote: > > On Aug 3, 2006, at 14:27, David Bear wrote: > > >Since this is a Suse 9.3 distro AND it has the python 2.4 and PIL rpms > >installed for that -- I'm wondering if the pil configurator is finding > >something there. > > > >Since I installed a separate python for a particular zope that I > >needed, something must be getting confused. > > > >what specific .so modules does the pil installer look for? Is there > >some way I can tell it to ignore _image*.so files that existed for the > >packaged version of python? > > To throw a somewhat uneducated opinion in, it's likely not looking for > .so files or at least JUST the .so files, but include files, since it > needs those to compile against them. okay... so what do you suggest? Is there some higher level documentation on what the PIL installer looks for so I can control that? -- David Bear phone: 602-496-0424 fax: 602-496-0955 College of Public Programs/ASU University Center Rm 622 411 N Central Phoenix, AZ 85007-0685 "Beware the IP portfolio, everyone will be suspect of trespassing" From bruce.who.hk at gmail.com Sun Aug 6 03:40:28 2006 From: bruce.who.hk at gmail.com (Bruce Who) Date: Sun, 6 Aug 2006 09:40:28 +0800 Subject: [Image-SIG] [PIL]how to change the default fill color Message-ID: Hi, all, I'm a newbie to PIL, and is stumped with a issue: I use following statement to convert a image: imout = im.transform((500,500),AFFIN,(1,0.5,0,0,0.5,0)) and I find out that some part of 'imout' is filled with black color, how to make PIL fill the area with other colors or just keep it transparent by default instead of just with black? I have searched the web and cannot get any ideas. I'll appreciate any ideas. Thanks in advance. Bruce From David.Bear at asu.edu Wed Aug 9 02:20:22 2006 From: David.Bear at asu.edu (David Bear) Date: Tue, 8 Aug 2006 17:20:22 -0700 Subject: [Image-SIG] tricky setup for multiple pythons Message-ID: <20060809002022.GJ14607@asu.edu> I have a need to run multiple python versions. The version of python that came with my distribution works for many sysadmin scripts that come with that version and needs to remain in place. I also need to run zope with requires a newer python version. I do have a PIL rpm that installed pil in the python that came with my distribution. PIL found all the jpeg and png libraries it needed for that version so I am confident that everything PIL wants is installed in my system. so I built python with prefix=/work/webenv now, when I build PIL I used that particular version of python and invoke it as /work/webenv/bin/python setup.py build_ext the PIL setup cannot find libjpeg.. so I modified setup.py and hardwire the directories JPEG_ROOT = "/usr/lib64" ZLIB_ROOT = "/usr/lib64" Still, setup.py cannot find jpeg libraries.. I'm really lost on what setup.py is really looking for, and how to make sure it finds it. Again, I do have PIL installed and working for the version of python that was packaged with my distribution. But I need a different version of python to run zope. Any pointers would be appreciated. -- David Bear phone: 602-496-0424 fax: 602-496-0955 College of Public Programs/ASU University Center Rm 622 411 N Central Phoenix, AZ 85007-0685 "Beware the IP portfolio, everyone will be suspect of trespassing" From chris at cogdon.org Wed Aug 9 02:26:37 2006 From: chris at cogdon.org (Chris Cogdon) Date: Tue, 8 Aug 2006 17:26:37 -0700 Subject: [Image-SIG] tricky setup for multiple pythons In-Reply-To: <20060809002022.GJ14607@asu.edu> References: <20060809002022.GJ14607@asu.edu> Message-ID: <4465aace3c60a3fcd87be695c0ddae47@cogdon.org> On Aug 8, 2006, at 17:20, David Bear wrote: > I have a need to run multiple python versions. The version of python > that came with my distribution works for many sysadmin scripts that > come with that version and needs to remain in place. I also need to > run zope with requires a newer python version. > > I do have a PIL rpm that installed pil in the python that came with my > distribution. PIL found all the jpeg and png libraries it needed for > that version so I am confident that everything PIL wants is installed > in my system. > > so I built python with prefix=/work/webenv > > now, when I build PIL I used that particular version of python and > invoke it as > > /work/webenv/bin/python setup.py build_ext > > the PIL setup cannot find libjpeg.. > > so I modified setup.py and hardwire the directories > > JPEG_ROOT = "/usr/lib64" > ZLIB_ROOT = "/usr/lib64" > > Still, setup.py cannot find jpeg libraries.. > > I'm really lost on what setup.py is really looking for, and how to > make sure it finds it. > > Again, I do have PIL installed and working for the version of python > that was packaged with my distribution. But I need a different version > of python to run zope. Any pointers would be appreciated. Setup needs the include files, not the libraries. Make sure you have the '-devel' versions of the packages for the libraries installed. -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From jmikulasek at gmail.com Wed Aug 9 14:57:14 2006 From: jmikulasek at gmail.com (=?ISO-8859-2?Q?Ji=F8=ED_Mikul=E1=B9ek?=) Date: Wed, 9 Aug 2006 14:57:14 +0200 Subject: [Image-SIG] mixing vector and raster drawing with aggdraw Message-ID: <89681a450608090557mf73c03tb5590c52f947fb07@mail.gmail.com> Hello, I am using aggdraw to implement a simple map viewer. I get a rendered background map from Mapserver/Mapscript and then pass it to aggdraw.Draw through a PIL.Image to draw a position (and shape) of some objects (trees, benches, ...). Such an object might be drawn as a circle or polygon which is fine with Draw class, however some objects need to be drawn as small bitmaps. It seems to me that Draw class does not support pasting bitmaps and I have to flush previously drawn objects to the underlying PIL.Image, paste the bitmap using Image.paste and then create a new Draw instance. If I understand it correctly this involves a lot of memory copying. Is there some other way for me to mix the vector and raster drawing with aggdraw? Or is that possible with aggdraw without the switching between Draw and Image? I know that I might minimize the swithing with some clever preprocessing but it would make the code more complicated and I would like to do it only if I do not find another way. Thank you Jirka Mikulasek PS.: aggdraw is a really nice tool, thank you for it From sean.berry at cox.net Wed Aug 9 18:37:09 2006 From: sean.berry at cox.net (sean.berry at cox.net) Date: Wed, 9 Aug 2006 9:37:09 -0700 Subject: [Image-SIG] Image Transform with Perspective Message-ID: <31693486.1155141430052.JavaMail.root@fed1wml01.mgt.cox.net> Okay, so here is the situation. I have need to do some on-the-fly image creation. I have everything working great except for the last part of it, applying a perspective type transform to the image. The transform will take a rectangular 2D image and transform it to a 3D representation in 2D. Please see the link to see what I am trying to do: http://seanberry.com/transform.png I have PIL v1.15 installed which has a PERSPECTIVE transform, but it does not appear to do what I want - or I can't figure out how to use it correctly because it is using a transform matrix's coefficients. Here is the only info I could find on the usage: http://mail.python.org/pipermail/image-sig/2005-February/003198.html This is for the creation of images to be used in Flash. Originally I was doing the image processing in Flash because Flash 8 has a BitmapData class which does the basics of images, copy, transform, etc. To accomplish the transform I was using an algorithm that approximated triangles to fill and worked really well, but I need the image processing to be server side, not client. So, here I am. Anyone have any idea how to accomplish my goal here? Is there a way to fill a triangle with a bitmap using PIL so I could use the Flash alogithm? What about better docs on the PERSPECTIVE transform or an example of how to accomplish my desired transform? Thanks for any and all help on this. From David.Bear at asu.edu Wed Aug 9 19:12:42 2006 From: David.Bear at asu.edu (David Bear) Date: Wed, 9 Aug 2006 10:12:42 -0700 Subject: [Image-SIG] tricky setup for multiple pythons In-Reply-To: <4465aace3c60a3fcd87be695c0ddae47@cogdon.org> References: <20060809002022.GJ14607@asu.edu> <4465aace3c60a3fcd87be695c0ddae47@cogdon.org> Message-ID: <20060809171242.GC15939@asu.edu> On Tue, Aug 08, 2006 at 05:26:37PM -0700, Chris Cogdon wrote: > > On Aug 8, 2006, at 17:20, David Bear wrote: > > >I have a need to run multiple python versions. The version of python > >that came with my distribution works for many sysadmin scripts that > >come with that version and needs to remain in place. I also need to > >run zope with requires a newer python version. > > > >I do have a PIL rpm that installed pil in the python that came with my > >distribution. PIL found all the jpeg and png libraries it needed for > >that version so I am confident that everything PIL wants is installed > >in my system. > > > >so I built python with prefix=/work/webenv > > > >now, when I build PIL I used that particular version of python and > >invoke it as > > > >/work/webenv/bin/python setup.py build_ext > > > >the PIL setup cannot find libjpeg.. > > > >so I modified setup.py and hardwire the directories > > > >JPEG_ROOT = "/usr/lib64" > >ZLIB_ROOT = "/usr/lib64" > > > >Still, setup.py cannot find jpeg libraries.. > > > >I'm really lost on what setup.py is really looking for, and how to > >make sure it finds it. > > > >Again, I do have PIL installed and working for the version of python > >that was packaged with my distribution. But I need a different version > >of python to run zope. Any pointers would be appreciated. > > Setup needs the include files, not the libraries. Make sure you have > the '-devel' versions of the packages for the libraries installed. > thanks. I assumed the rpm for PIL would have looked for devel packages -- but it looks like it was all precompiled. -- David Bear phone: 602-496-0424 fax: 602-496-0955 College of Public Programs/ASU University Center Rm 622 411 N Central Phoenix, AZ 85007-0685 "Beware the IP portfolio, everyone will be suspect of trespassing" From chris at cogdon.org Wed Aug 9 19:15:15 2006 From: chris at cogdon.org (Chris Cogdon) Date: Wed, 9 Aug 2006 10:15:15 -0700 Subject: [Image-SIG] tricky setup for multiple pythons In-Reply-To: <20060809171242.GC15939@asu.edu> References: <20060809002022.GJ14607@asu.edu> <4465aace3c60a3fcd87be695c0ddae47@cogdon.org> <20060809171242.GC15939@asu.edu> Message-ID: <93202d0b936c4ddbc99c8a86a1758822@cogdon.org> On Aug 9, 2006, at 10:12, David Bear wrote: > thanks. I assumed the rpm for PIL would have looked for devel packages > -- but it looks like it was all precompiled. PIL itself doesn't know about RPMs, it only looks for the include files which the "-devel" packages install for you. It might be that the RPMs for other packages would look for the -devel packages before even starting, but that would mean you would not be able to create a "lightweight" PIL without installing a bunch of unnecessary stuff (or telling the RPM build process to ignore the missing "-devel" packages). -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From fredrik at pythonware.com Mon Aug 14 14:21:46 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Mon, 14 Aug 2006 14:21:46 +0200 Subject: [Image-SIG] mixing vector and raster drawing with aggdraw References: <89681a450608090557mf73c03tb5590c52f947fb07@mail.gmail.com> Message-ID: "Jirí Mikulásek" wrote: > It seems to me that Draw class does not support pasting bitmaps > and I have to flush previously drawn objects to the underlying PIL.Image, > paste the bitmap using Image.paste and then create a new Draw instance. > If I understand it correctly this involves a lot of memory copying. correct. > Is there some other way for me to mix the vector and raster drawing with > aggdraw? Or is that possible with aggdraw without the switching between > Draw and Image? not at this time, I'm afraid. I'll look into this for future aggdraw releases. From fredrik at pythonware.com Tue Aug 15 23:49:06 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 15 Aug 2006 23:49:06 +0200 Subject: [Image-SIG] [PIL]how to change the default fill color In-Reply-To: References: Message-ID: Bruce Who wrote: > I'm a newbie to PIL, and is stumped with a issue: I use following > statement to convert a image: > > imout = im.transform((500,500),AFFIN,(1,0.5,0,0,0.5,0)) > > and I find out that some part of 'imout' is filled with black color, > how to make PIL fill the area with other colors or just keep it > transparent by default instead of just with black? I have searched the > web and cannot get any ideas. > > I'll appreciate any ideas. Thanks in advance. there's no way to do this in 1.1.5; to get the result you want, you can warp a "solid" image using the same transform, and use that as a mask. something like this should work: size = 500, 500 data = im.transform(size, AFFINE, (1,0.5,0,0,0.5,0)) mask = Image.new("L", im.size, 255) mask = mask.transform(size, AFFINE, ...) imout = Image.new("RGB", size, "red") imout.paste(data, mask) From jingweisun at gmail.com Wed Aug 16 19:23:05 2006 From: jingweisun at gmail.com (Jingwei Sun) Date: Thu, 17 Aug 2006 01:23:05 +0800 Subject: [Image-SIG] help:how to install freetype without root privilege. Message-ID: <7dcb14fa0608161023h482bb516laed019f3320e73c5@mail.gmail.com> as the title says. and how can I install ImageMagic of Python without root privilege. can someone show me some instructions? thx. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060817/7a228301/attachment.html From Mapo.Hsueh at BenQ.com Fri Aug 18 04:18:59 2006 From: Mapo.Hsueh at BenQ.com (Mapo Hsueh) Date: Fri, 18 Aug 2006 10:18:59 +0800 Subject: [Image-SIG] Hi, how to Register Python script Message-ID: <40D3316355A38044BE4F5807821B4DB709AC65@BQT-MSV13.BENQ.corp.com> Hi, Sir I am a new hand about Python. I download the PIL 1.1.5 for Python2.4 and try to install it. Of course, I meet the problem that windows has no such registry. And the script is found in http://effbot.org/zone/python-register.htm . But I have no idea about how to install it. Could you tell me? Thanks your help. Mapo **********************Confidentiality Notice************************ The opinions and views expressed in this e-mail are solely those of the author and do not necessarily represent those of BenQ Corporation and its affiliates. BenQ Corporation is not responsible for any liability or damaged caused by viruses transmitted with this e-mail or its attachments. If this e-mail is not originally intended for you, or received by you in error, do not disclose its content to anyone and delete it immediately. This e-mail may contain information that is legally privileged, confidential or exempt from disclosure. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060818/ff36abc1/attachment.htm From fredrik at pythonware.com Fri Aug 18 14:40:31 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 18 Aug 2006 14:40:31 +0200 Subject: [Image-SIG] Hi, how to Register Python script References: <40D3316355A38044BE4F5807821B4DB709AC65@BQT-MSV13.BENQ.corp.com> Message-ID: Mapo Hsueh wrote: > I am a new hand about Python. > I download the PIL 1.1.5 for Python2.4 and try to install it. > Of course, I meet the problem that windows has no such registry. of course? how did you install Python in the first place? what installation kit are you using? > And the script is found in http://effbot.org/zone/python-register.htm > . > > But I have no idea about how to install it. run it using the installed Python interpreter. From angelol at easyconnect.fr Fri Aug 18 19:03:10 2006 From: angelol at easyconnect.fr (Angelo) Date: Fri, 18 Aug 2006 19:03:10 +0200 Subject: [Image-SIG] Convert RGB to RGBA Message-ID: <1155920590.7473.4.camel@localhost> Hello, Is it possible to convert a RGB image (png, tga or gif image) to RGBA with PIL, and how to do that ? . With im.convert(mode, matrix) ? . a+ From fredrik at pythonware.com Fri Aug 18 19:27:08 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 18 Aug 2006 19:27:08 +0200 Subject: [Image-SIG] Convert RGB to RGBA In-Reply-To: <1155920590.7473.4.camel@localhost> References: <1155920590.7473.4.camel@localhost> Message-ID: Angelo wrote: > Is it possible to convert a RGB image (png, tga or gif image) to RGBA > with PIL, and how to do that ? . With im.convert(mode, matrix) ? . the alpha layer controls transparency, and doesn't have any direct relation to the RGB values. to add an alpha layer to an image, you can use a direct convert: imOut = im.convert("RGBA") # sets alpha to 255 if you have an RGB image, you can also modify it in place im.putalpha(value) # set alpha to given value or im.putalpha(matte) # where matte is a mode "L" image From angelol at easyconnect.fr Sat Aug 19 00:55:26 2006 From: angelol at easyconnect.fr (Angelo) Date: Sat, 19 Aug 2006 00:55:26 +0200 Subject: [Image-SIG] Convert RGB to RGBA In-Reply-To: References: <1155920590.7473.4.camel@localhost> Message-ID: <1155941726.7814.8.camel@localhost> On ven, 2006-08-18 at 19:27 +0200, Fredrik Lundh wrote: > the alpha layer controls transparency, and doesn't have any direct > relation to the RGB values. to add an alpha layer to an image, you can > use a direct convert: > > imOut = im.convert("RGBA") # sets alpha to 255 > > if you have an RGB image, you can also modify it in place > > im.putalpha(value) # set alpha to given value > > or > > im.putalpha(matte) # where matte is a mode "L" image > > Thanks Fredrik ! . That is what I would like to make : I have numerous blue pixels with the RGB value - > (36, 103, 210) and I would like to return the totally transparent image only where there are pixels with this value (36, 103, 210) . It is possible (?) and if yes how can it be done ? . I apologize if my demand seems stupid (also for my bad english), but I have no experience with PIL . a+ From paul.prescod at xmetal.com Sat Aug 19 01:26:50 2006 From: paul.prescod at xmetal.com (Paul Prescod) Date: Fri, 18 Aug 2006 16:26:50 -0700 Subject: [Image-SIG] PIL Programming Questions Message-ID: I just finished a PIL program and I feel like there may have been more efficient ways to do things I did "by hand" with the raw data. Can someone enlighten me? 1. I wanted to take 24 bit data, count the colours and make an 8-bit BMP if there are fewer than 256 colours. My brute force solution required me to build the palette by hand from the data and rewrite the data one pixel at a time. (a simple '.convert("P")' seems to use an arbitrary palette or something???) 2. I wanted to pad a bitmap by adding some space to the right and bottom. I did this by creating a new one and pasting the old one into it. 3. I wanted to convert every occurrence of one colour to another. I walked each pixel. I also could not figure out how to get to a 4-bit BMP. I inferred from the documentation that this just isn't possible with out of box PIL. Overall: PIL really rocks. Paul Prescod From nick.delorenzo at gmail.com Tue Aug 22 09:02:45 2006 From: nick.delorenzo at gmail.com (Nick De Lorenzo) Date: Tue, 22 Aug 2006 17:02:45 +1000 Subject: [Image-SIG] Hi Message-ID: On 8/19/06, Paul Prescod wrote: > I just finished a PIL program and I feel like there may have been more > efficient ways to do things I did "by hand" with the raw data. Can > someone enlighten me? > > 1. I wanted to take 24 bit data, count the colours and make an 8-bit BMP > if there are fewer than 256 colours. My brute force solution required me > to build the palette by hand from the data and rewrite the data one > pixel at a time. (a simple '.convert("P")' seems to use an arbitrary > palette or something???) > > 2. I wanted to pad a bitmap by adding some space to the right and > bottom. I did this by creating a new one and pasting the old one into > it. > > 3. I wanted to convert every occurrence of one colour to another. I > walked each pixel. > > I also could not figure out how to get to a 4-bit BMP. I inferred from > the documentation that this just isn't possible with out of box PIL. > > Overall: PIL really rocks. > > Paul Prescod > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From nick.delorenzo at gmail.com Tue Aug 22 09:04:15 2006 From: nick.delorenzo at gmail.com (Nick De Lorenzo) Date: Tue, 22 Aug 2006 17:04:15 +1000 Subject: [Image-SIG] Mailing List Message-ID: Hi, Can I be taken off this mailing list? i followed the link but it asked for a password and I can't remember mine. If I could be taken off it would be greatly appriciated. Thanks, Nick From fredrik at pythonware.com Tue Aug 22 09:53:01 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 22 Aug 2006 09:53:01 +0200 Subject: [Image-SIG] Mailing List In-Reply-To: References: Message-ID: Nick De Lorenzo wrote: > Can I be taken off this mailing list? i followed the link but it asked > for a password and I can't remember mine. there's a "password reminder" section just under the "unsubscribe" section; I just clicked on the reminder button for you. From fredrik at pythonware.com Tue Aug 22 12:40:38 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 22 Aug 2006 12:40:38 +0200 Subject: [Image-SIG] PIL Programming Questions References: Message-ID: Paul Prescod wrote: > 1. I wanted to take 24 bit data, count the colours and make an 8-bit BMP > if there are fewer than 256 colours. My brute force solution required me > to build the palette by hand from the data and rewrite the data one > pixel at a time. (a simple '.convert("P")' seems to use an arbitrary > palette or something???) colors = im.getcolors() if colors is None: print "image has more than 256 colors" else: print "image has", len(colors) im.getcolors() returns a list of all colours in an image, and by default, it stops counting if it finds more than 256 colors: http://www.effbot.org/imagingbook/image.htm#Image.getcolors > 2. I wanted to pad a bitmap by adding some space to the right and > bottom. I did this by creating a new one and pasting the old one into > it. that's the usual way to do this. > 3. I wanted to convert every occurrence of one colour to another. I > walked each pixel. you can use the (undocumented) quantize method for this: >>> import Image >>> im = Image.open("/images/photo.im") >>> im.getcolors() >>> len(im.getcolors(im.size[0]*im.size[1])) 119023 >>> im = im.quantize(256) >>> len(im.getcolors()) 256 > I also could not figure out how to get to a 4-bit BMP. I inferred from > the documentation that this just isn't possible with out of box PIL. afaik, no. patches are welcome. > Overall: PIL really rocks. thanks! cheers /F From fredrik at pythonware.com Tue Aug 22 14:01:13 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 22 Aug 2006 14:01:13 +0200 Subject: [Image-SIG] Subsampling in Thumbnail Mode for Jpeg files..? References: Message-ID: Andreas Schmidt wrote: > Sorry, I have a couple of questions: > > 1. When I create a thumbnail with PIL it is extremly fast! Is this speadup > due to the subsampling (using only the DC component) alone ? Or are there > some other tricks ? Simplified decoding is the only real "trick" here. > 2. In thumbnail-Mode - does PIL still read the full jpeg stream from disk > and then only reads the Bytes of the DC component ? Or does PIL directly > read less Bytes from the disk, i.e. only the Bytes of the DC component ? > How does it "know" which Bytes belong to the DC component ? JPEG data consists of a compressed stream of DCT coefficients; to put the original image back together, a JPEG decoder needs to decompress the co- efficients, feed them through an inverse DCT transform, and use the result to put the output image back together. if the thumbnails are small enough, PIL skips the DCT step, using only the DC component (=the average color for that 8x8 block). > 3. I guess 1/8 is the limit for subsampling since 8x8 blocks are used and > PIL is taking only the DC component is that case ? correct. > 4. What tricks is PIL using to speed up Thumbnail creation ? I think we've gone through that more than once by now ;-) From dg76 at cornell.edu Tue Aug 22 22:29:20 2006 From: dg76 at cornell.edu (Dan Gaibel) Date: Tue, 22 Aug 2006 16:29:20 -0400 Subject: [Image-SIG] Help with libjpeg Message-ID: <12672C7F-8EFD-4BD8-B04E-45632FBD41D0@cornell.edu> I am having serious problems trying to compile libjpeg, which I need for JPEG support in the Python Imaging Library. After bumping into several walls realized that I need to configure the libjpeg compilation with the enable-shared flag, as follows: ./configure --enable-shared However, this results in an error: checking host system type... Invalid configuration `x86_64-unknown- linux-gnu': machine `x86_64-unknown' not recognized ...which does not allow the compilation to work. I've looked into the error but all of the solutions seem to be package specific and have nothing to do with libjpeg. The worst thing is that libjpeg is, in fact, installed in the system. For some reason the libjpeg.so.62 file in /usr/lib cannot be read by setup.py. Has anyone encountered this error? It's mission critical that I get PIL properly installed on this machine. Any help is greatly appreciated! Thanks, Dan From bob at redivi.com Tue Aug 22 22:36:42 2006 From: bob at redivi.com (Bob Ippolito) Date: Tue, 22 Aug 2006 13:36:42 -0700 Subject: [Image-SIG] Help with libjpeg In-Reply-To: <12672C7F-8EFD-4BD8-B04E-45632FBD41D0@cornell.edu> References: <12672C7F-8EFD-4BD8-B04E-45632FBD41D0@cornell.edu> Message-ID: <6a36e7290608221336q1da03534m40b8aa54fb95050f@mail.gmail.com> On 8/22/06, Dan Gaibel wrote: > I am having serious problems trying to compile libjpeg, which I need > for JPEG support in the Python Imaging Library. After bumping into > several walls realized that I need to configure the libjpeg > compilation with the enable-shared flag, as follows: > ./configure --enable-shared > > However, this results in an error: > > checking host system type... Invalid configuration `x86_64-unknown- > linux-gnu': machine `x86_64-unknown' not recognized > > ...which does not allow the compilation to work. I've looked into the > error but all of the solutions seem to be package specific and have > nothing to do with libjpeg. > > The worst thing is that libjpeg is, in fact, installed in the system. > For some reason the libjpeg.so.62 file in /usr/lib cannot be read by > setup.py. > > Has anyone encountered this error? It's mission critical that I get > PIL properly installed on this machine. Any help is greatly appreciated! > You probably need to install some kind of jpeg-devel package in order to get the header file so that you can use the system libjpeg. -bob From fredrik at pythonware.com Tue Aug 22 22:56:06 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Tue, 22 Aug 2006 22:56:06 +0200 Subject: [Image-SIG] Help with libjpeg In-Reply-To: <12672C7F-8EFD-4BD8-B04E-45632FBD41D0@cornell.edu> References: <12672C7F-8EFD-4BD8-B04E-45632FBD41D0@cornell.edu> Message-ID: Dan Gaibel wrote: > The worst thing is that libjpeg is, in fact, installed in the system. > For some reason the libjpeg.so.62 file in /usr/lib cannot be read by > setup.py. PIL's build process needs the header files too. > Has anyone encountered this error? It's mission critical that I get > PIL properly installed on this machine. Any help is greatly appreciated! have you looked for python-imaging packages for your platform? or at least jpeg-devel (or libjpeg-devel) packages? From tim at alwaysreformed.com Thu Aug 24 08:07:45 2006 From: tim at alwaysreformed.com (Tim Black) Date: Wed, 23 Aug 2006 23:07:45 -0700 Subject: [Image-SIG] Save GIF with transparency Message-ID: <44ED4231.7020808@alwaysreformed.com> I'm writing a small wxPython application that performs a hue rotation on all graphics and CSS files in a website template. It successfully displays and saves PNG files with transparency, but cannot save GIF files with transparency from wxPython, so I'm trying to save a transparent GIF from PIL, so far without success. The hue rotation works, the code saves the GIF in a file, but the GIF's pixels that should be transparent come out black. This is a PIL question because I'm converting a wx.Image to a PIL.Image and using PIL to save the GIF. I've read and tested nearly everything about this question I can turn up on Google and my code still doesn't work. Could someone here recommend a fix to my attached working sample code (probably to line 39 or 41)? Thank you! Tim Black -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060823/56207b40/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: logo.gif Type: image/gif Size: 8612 bytes Desc: not available Url : http://mail.python.org/pipermail/image-sig/attachments/20060823/56207b40/attachment.gif -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: im2pil-fails.py Url: http://mail.python.org/pipermail/image-sig/attachments/20060823/56207b40/attachment.pot From izakmarais at yahoo.com Tue Aug 29 10:49:55 2006 From: izakmarais at yahoo.com (izak marais) Date: Tue, 29 Aug 2006 01:49:55 -0700 (PDT) Subject: [Image-SIG] save() question/bug Message-ID: <20060829084955.4331.qmail@web50904.mail.yahoo.com> Hi all When I try to save an image (that has been converted from a numpy array using scipy.misc.toimage(array) ) the line width seems to be mixed up. Images come out slightly skewed with a black line which sould be the end of the image shifted into the image itself. I installed 1.1.6b1 since there is mention of a line width bug fix in version 1.1.6a1, however the problem persists. Also it cannot be a fault with the conversion from array process since calling show() om the image displays it perfectly. The problem only occurs when saving. I've tried saving to different formats, this just changes the "skewness" of the image and the position of the black line. Is this a known bug or am I doing something wrong? Thanks Izak --------------------------------- Get your email and more, right on the new Yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20060829/630f32e8/attachment.htm From fredrik at pythonware.com Wed Aug 30 11:50:42 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 30 Aug 2006 11:50:42 +0200 Subject: [Image-SIG] save() question/bug References: <20060829084955.4331.qmail@web50904.mail.yahoo.com> Message-ID: "izak marais" wrote: > Also it cannot be a fault with the conversion from array process since calling > show() om the image displays it perfectly. The problem only occurs when saving. > I've tried saving to different formats, this just changes the "skewness" of the > image and the position of the black line. show() does save the image, though, so that's a bit puzzling. does the image still look good if you do im.save("out.im", "IM") im = Image.open("out.im") im.show() after you've done show() in the usual way? what happens if you replace the above with: im.im.save_ppm("out.ppm") # note "im.im" im = Image.open("out.ppm") im.show() From donn.ingle at gmail.com Wed Aug 30 14:35:25 2006 From: donn.ingle at gmail.com (Donn) Date: Wed, 30 Aug 2006 14:35:25 +0200 Subject: [Image-SIG] python app using PIL - GPL question Message-ID: <200608301435.25765.donn.ingle@gmail.com> Hello list, I am writing an app in Python + wxPython and it also uses PIL. I want to licence it as Gnu GPL, but have never done this kind of thing before. Is it alright to use PIL and use GPL as the licence in my code? Thanks, Donn. From fredrik at pythonware.com Wed Aug 30 16:14:04 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 30 Aug 2006 16:14:04 +0200 Subject: [Image-SIG] python app using PIL - GPL question References: <200608301435.25765.donn.ingle@gmail.com> Message-ID: "Donn" wrote: > I am writing an app in Python + wxPython and it also uses PIL. > I want to licence it as Gnu GPL, but have never done this kind of thing > before. Is it alright to use PIL and use GPL as the licence in my code? PIL uses the old-style Python license, which is considered to be GPL compatible by the FSF (look for "License of Python 1.6a2 and earlier versions" in their list), so mixing things shuold be perfectly okay. If you build stuff on top of PIL that would be useful to other PIL users, outside your application (e.g. file format drivers, new image processing algorithms, etc.), it's of course nice to license those parts under a non-GPL license, but that's up to you. From donn.ingle at gmail.com Wed Aug 30 16:18:15 2006 From: donn.ingle at gmail.com (Donn) Date: Wed, 30 Aug 2006 16:18:15 +0200 Subject: [Image-SIG] python app using PIL - GPL question In-Reply-To: References: <200608301435.25765.donn.ingle@gmail.com> Message-ID: <200608301618.15687.donn.ingle@gmail.com> > PIL uses the old-style Python license, which is considered to be GPL > compatible by the FSF (look for "License of Python 1.6a2 and earlier > versions" in their list), so mixing things shuold be perfectly okay. Thanks for the info. That's good news. > If you build stuff on top of PIL that would be useful to other PIL users, > outside your application (e.g. file format drivers, new image processing > algorithms, etc.), it's of course nice to license those parts under a > non-GPL license, but that's up to you. Okay. I am only doing an : import Image, ImageFont, ImageDraw So, I should be clear. Donn. From ghalib at sent.com Thu Aug 31 01:41:26 2006 From: ghalib at sent.com (Ghalib Suleiman) Date: Wed, 30 Aug 2006 19:41:26 -0400 Subject: [Image-SIG] doubles? Message-ID: <0BFA1FB6-B109-44AA-A98F-B97BE1DC7670@sent.com> I want to convert my image to doubles, such that each entry in the R,G,B tuple is a double lying in the range [0,1] (this will be then passed onto NumPy for some arithmetic). Is this possible? Thanks in advance. From Chris.Barker at noaa.gov Thu Aug 31 01:46:40 2006 From: Chris.Barker at noaa.gov (Chris Barker) Date: Wed, 30 Aug 2006 16:46:40 -0700 Subject: [Image-SIG] doubles? In-Reply-To: <0BFA1FB6-B109-44AA-A98F-B97BE1DC7670@sent.com> References: <0BFA1FB6-B109-44AA-A98F-B97BE1DC7670@sent.com> Message-ID: <44F62360.2010300@noaa.gov> Ghalib Suleiman wrote: > I want to convert my image to doubles, such that each entry in the > R,G,B tuple is a double lying in the range [0,1] (this will be then > passed onto NumPy for some arithmetic). why not pass the data to numpy, then convert -- that will be a lot easier. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker at noaa.gov