From robert.klimek@grc.nasa.gov Tue Apr 4 21:48:00 2000 From: robert.klimek@grc.nasa.gov (Bob Klimek) Date: Tue, 04 Apr 2000 16:48:00 -0400 Subject: [Image-SIG] display of PIL image with a palette Message-ID: <38EA5500.C2BC7C95@grc.nasa.gov> Hello, Does anyone know how to display a paletted PIL image in wxPython? The PIL image mode is "P". I'm attempting to pseudocolor an 8-bit grayscale image by applying an RGB palette (256 RGB values). The program seems to be displaying the new image. Bob -- --------------------- Robert B. Klimek NASA Glenn Research Center robert.klimek@grc.nasa.gov --------------------- From ctallis@ers.com Wed Apr 5 05:32:21 2000 From: ctallis@ers.com (Carl Tallis) Date: Wed, 5 Apr 2000 00:32:21 -0400 Subject: [Image-SIG] Can't run PIL Message-ID: <38EAC716.260F4F23@ers.com> Hi - I'm trying to run PIL, both inside Zope and outside, and just keep getting the message "The _imaging C module is not installed". I've traced it back to class _imaging_not_installed getting thrown, but I can't figure out why. _imaging.dll is present. Any ideas? Thx, Carl From fredrik@pythonware.com Wed Apr 5 09:43:49 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 5 Apr 2000 10:43:49 +0200 Subject: [Image-SIG] Can't run PIL References: <38EAC716.260F4F23@ers.com> Message-ID: <006001bf9edb$c4a446b0$0500a8c0@secret.pythonware.com> Carl Tallis wrote: > I'm trying to run PIL, both inside Zope and > outside, and just keep getting the message "The > _imaging C module is not installed". I've > traced it back to class _imaging_not_installed > getting thrown, but I can't figure out why.=20 > _imaging.dll is present. Any ideas? present or not, it seems PIL isn't able import it. try importing _imaging by hand, and see what happens. From Brian.Lamarche@pnl.gov Wed Apr 5 16:41:34 2000 From: Brian.Lamarche@pnl.gov (Lamarche, Brian L) Date: Wed, 05 Apr 2000 08:41:34 -0700 Subject: [Image-SIG] Vtk Help Message-ID: Does any one work with VTK or Tkinter that can help render some images? What I need to do is render some images that I have already created using Tkinter. Can anyone help me or point me to where I can find a way to do this. Thanks, Brian From robert.klimek@grc.nasa.gov Wed Apr 5 20:19:56 2000 From: robert.klimek@grc.nasa.gov (Bob Klimek) Date: Wed, 05 Apr 2000 15:19:56 -0400 Subject: [Image-SIG] displaying PIL image with a palette Message-ID: <38EB91DC.90915E74@grc.nasa.gov> Yesterday I posted a message asking if anybody knows how to display a PIL image of type "P" (with a palette) using wxPython. I've got no replys but I got it working another way - producing a 24-bit pseudocolor image as output. For anyone interested here it is: Convert the 8-bit image to 24-bit image (img = im.convert("RGB")). Then just call the point function as (out = img.point(palette)) where palette is a list of 256 red, 256 green, and 256 blue values. out is a 24-bit color (pseudocolor) image which can now be displayed in wxPython (after a conversion using SetData) Bob -- --------------------- Robert B. Klimek NASA Glenn Research Center robert.klimek@grc.nasa.gov --------------------- From anthony@interlink.com.au Thu Apr 6 07:19:23 2000 From: anthony@interlink.com.au (Anthony Baxter) Date: Thu, 06 Apr 2000 16:19:23 +1000 Subject: [Image-SIG] Group3 TIFFs? Message-ID: <200004060619.QAA15776@mbuna.arbhome.com.au> Is anyone aware of a decoder for group 3 TIFFs under PIL? Or alternatives for allowing easy manipulation of these? Ta, Anthony -- Anthony Baxter It's never too late to have a happy childhood. From Brian.Lamarche@pnl.gov Fri Apr 7 17:57:16 2000 From: Brian.Lamarche@pnl.gov (Lamarche, Brian L) Date: Fri, 07 Apr 2000 09:57:16 -0700 Subject: [Image-SIG] VTK Message-ID: Does anyone know how to link the PIL on a Unix box And Has anyone used VTK? Brian LaMarche From Adeniyi Adebowale Oke" This is a multi-part message in MIME format. ------=_NextPart_000_000F_01BFA2E7.0507B700 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Can anybody help me over there as quick as possible. I download the PIL = and find out that i cannot use the said library correctly. The error is = shown below. >>> import Image >>> im =3D Image.open('kimura.jpg') >>> im.show() Traceback (innermost last): File "", line 1, in ? im.show() File "c:\progra~1\python\py152\PIL\Image.py", line 694, in show _showxv(self, title, command) File "c:\progra~1\python\py152\PIL\Image.py", line 974, in _showxv file =3D self._dump(format=3Dformat) File "c:\progra~1\python\py152\PIL\Image.py", line 307, in _dump self.load() File "c:\progra~1\python\py152\PIL\ImageFile.py", line 125, in load self.load_prepare() File "c:\progra~1\python\py152\PIL\ImageFile.py", line 175, in = load_prepare self.im =3D Image.core.new(self.mode, self.size) File "c:\progra~1\python\py152\PIL\Image.py", line 40, in __getattr__ raise ImportError, "The _imaging C module is not installed" ImportError: The _imaging C module is not installed >>> =20 Simply, i cannot use all the image library correctly as expected. Niyi ------=_NextPart_000_000F_01BFA2E7.0507B700 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Can anybody help me over there as quick as possible. = I=20 download the PIL and find out that i cannot use the said library = correctly. The=20 error is shown below.
 
>>> import Image
>>> im =3D=20 Image.open('kimura.jpg')
>>> im.show()
Traceback = (innermost=20 last):
  File "<pyshell#2>", line 1, in=20 ?
    im.show()
  File=20 "c:\progra~1\python\py152\PIL\Image.py", line 694, in=20 show
    _showxv(self, title, command)
  File=20 "c:\progra~1\python\py152\PIL\Image.py", line 974, in=20 _showxv
    file =3D = self._dump(format=3Dformat)
  File=20 "c:\progra~1\python\py152\PIL\Image.py", line 307, in=20 _dump
    self.load()
  File=20 "c:\progra~1\python\py152\PIL\ImageFile.py", line 125, in=20 load
    self.load_prepare()
  File=20 "c:\progra~1\python\py152\PIL\ImageFile.py", line 175, in=20 load_prepare
    self.im =3D Image.core.new(self.mode, = self.size)
  File = "c:\progra~1\python\py152\PIL\Image.py",=20 line 40, in __getattr__
    raise ImportError, = "The=20 _imaging C module is not installed"
ImportError: The _imaging C = module=20 is not installed
>>> 
 
Simply, i cannot use all the image library correctly = as=20 expected.
 
Niyi
 
 
 
------=_NextPart_000_000F_01BFA2E7.0507B700-- From fredrik@pythonware.com Tue Apr 11 12:43:37 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Tue, 11 Apr 2000 13:43:37 +0200 Subject: [Image-SIG] Problem with PIL -Subscribe References: <001201bfa319$4fbc17a0$af81a8c0@oke.sask.trlabs.ca> Message-ID: <00bb01bfa3ab$2d77bc20$0500a8c0@secret.pythonware.com> Adeniyi Adebowale Oke wrote: > File "c:\progra~1\python\py152\PIL\Image.py", line 40, in __getattr__ > raise ImportError, "The _imaging C module is not installed" >ImportError: The _imaging C module is not installed > >>> =20 >=20 > Simply, i cannot use all the image library correctly as expected. make sure _imaging.dll (or _imaging.pyd, depending on the distribution) is installed in a directory along the python path. if you don't really care where it's installed, just place it in the same directory as the python executable. From fredrik@pythonware.com Tue Apr 11 12:44:46 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Tue, 11 Apr 2000 13:44:46 +0200 Subject: [Image-SIG] VTK References: Message-ID: <00c301bfa3ab$5fb58550$0500a8c0@secret.pythonware.com> Brian.Lamarche@pnl.gov wrote: > Does anyone know how to link the PIL on a Unix box I thought the README told you that? if you have tried and failed, please let us know what went wrong. From kcazabon" <00bb01bfa3ab$2d77bc20$0500a8c0@secret.pythonware.com> Message-ID: <000801bfa3c8$f353b800$16107118@rct1.bc.wave.home.com> On the other hand too, if you've installed the Win32 extensions for Python (see www.python.org), I have an installer that will automatically set everything up for you. It's available at: http://members.home.com/lenticular It's a self-extracting script that runs a Python setup file. Kevin. ----- Original Message ----- From: "Fredrik Lundh" To: "Adeniyi Adebowale Oke" ; Sent: Tuesday, April 11, 2000 4:43 AM Subject: Re: [Image-SIG] Problem with PIL -Subscribe Adeniyi Adebowale Oke wrote: > File "c:\progra~1\python\py152\PIL\Image.py", line 40, in __getattr__ > raise ImportError, "The _imaging C module is not installed" >ImportError: The _imaging C module is not installed > >>> > > Simply, i cannot use all the image library correctly as expected. make sure _imaging.dll (or _imaging.pyd, depending on the distribution) is installed in a directory along the python path. if you don't really care where it's installed, just place it in the same directory as the python executable. _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From rob@hooft.net Wed Apr 12 09:55:56 2000 From: rob@hooft.net (Rob W. W. Hooft) Date: Wed, 12 Apr 2000 10:55:56 +0200 (CEST) Subject: [Image-SIG] Tcl/Tk 8.3.0? Message-ID: <14580.14876.110374.31063@temoleh.chem.uu.nl> I have tried to use Tcl/Tk 8.3.0 with PIL under the CVS version of python. The result is a core dump in ImageTk. Anything I can do about this except downgrading? Program received signal SIGSEGV, Segmentation fault. 0x10b010a in ?? () (gdb) where #0 0x10b010a in ?? () #1 0x40350a4e in TkImaging_Init (interp=0x8283400) at ./Tk/tkImaging.c:189 #2 0x4034e4ac in _tkinit (self=0x0, args=0x838d7a0) at ./_imaging.c:2336 #3 0x8055350 in call_builtin (func=0x813ac28, arg=0x838d7a0, kw=0x0) at ceval.c:2428 #4 0x8055268 in PyEval_CallObjectWithKeywords (func=0x813ac28, arg=0x838d7a0, kw=0x0) at ceval.c:2393 .... Regards, Rob Hooft -- ===== rob@hooft.net http://www.xs4all.nl/~hooft/rob/ ===== ===== R&D, Nonius BV, Delft http://www.nonius.nl/ ===== ===== PGPid 0xFA19277D ========================== Use Linux! ========= From rob@hooft.net Wed Apr 12 11:48:28 2000 From: rob@hooft.net (Rob W. W. Hooft) Date: Wed, 12 Apr 2000 12:48:28 +0200 (CEST) Subject: [Image-SIG] Followup Message-ID: <14580.21628.542692.947192@temoleh.chem.uu.nl> Hm. I did make a stupid mistake: tkimage was using the wrong version of tcl/tk. I fixed that now, and also made the Tcl/Tk libraries statically linked. The python program still crashes in the same line, with a different stack trace. (gdb) where #0 chunk_free (ar_ptr=0x75ff8522, p=0x4025c28c) at malloc.c:3049 #1 0x40094fba in __libc_free (mem=0x4025c294) at malloc.c:3023 #2 0x403c22b0 in TclpFree () from /usr/local/nonius/lib/python1.6/lib-dynload/_imaging.so #3 0x4036e3ac in Tcl_Free () from /usr/local/nonius/lib/python1.6/lib-dynload/_imaging.so #4 0x403a7f71 in ResetObjResult () from /usr/local/nonius/lib/python1.6/lib-dynload/_imaging.so #5 0x403a7843 in Tcl_SetResult () from /usr/local/nonius/lib/python1.6/lib-dynload/_imaging.so #6 0x403cec29 in Tk_MainWindow () from /usr/local/nonius/lib/python1.6/lib-dynload/_imaging.so #7 0x40400ad0 in Tk_GetImageMasterData () from /usr/local/nonius/lib/python1.6/lib-dynload/_imaging.so #8 0x403c7132 in Tk_FindPhoto () from /usr/local/nonius/lib/python1.6/lib-dynload/_imaging.so #9 0x403540b9 in PyImagingPhoto (clientdata=0x0, interp=0x827fc88, argc=3, argv=0xbfffd6cc) at ./Tk/tkImaging.c:76 #10 0x4036a925 in TclInvokeStringCommand () from /usr/local/nonius/lib/python1.6/lib-dynload/_imaging.so #11 0x4020798a in EvalObjv () from /usr/local/nonius/lib/python1.6/lib-dynload/_tkinter.so #12 0x40207a9d in Tcl_EvalObjv () from /usr/local/nonius/lib/python1.6/lib-dynload/_tkinter.so #13 0x40159d49 in Tkapp_Call (self=0x81296c8, args=0x834ce18) at ./_tkinter.c:620 Help? From fredrik@pythonware.com Wed Apr 12 12:12:06 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 12 Apr 2000 13:12:06 +0200 Subject: [Image-SIG] Tcl/Tk 8.3.0? References: <14580.14876.110374.31063@temoleh.chem.uu.nl> Message-ID: <011401bfa46f$f0fb7640$0500a8c0@secret.pythonware.com> Rob Hooft wrote: > I have tried to use Tcl/Tk 8.3.0 with PIL under the CVS version of > python. The result is a core dump in ImageTk. Anything I can do about > this except downgrading? afaik, you're the first one trying PIL with both Tk 8.3.0 and the new object-based Tk interface in 1.6a. I'm afraid I don't have the slightest idea if the problem is in PIL, Tk 8.3, or the new Tk interface... you could try downgrading _tkinter.c only, and see if that helps (check the logs to see which version to use; the object changes was made a few weeks ago). ... speaking of 1.6, note that there are a few broken "append" calls in PIL 1.0, including these (as reported by checkappend): .\PIL\JpegImagePlugin.py(90): self.layer.append(t[0], ord(t[1])/16, ord(t[1])&15, ord(t[2])) .\PIL\PcfFontFile.py(129): p.append(i32(fp.read(4)), ord(fp.read(1)), i32(fp.read(4))) .\PIL\TiffImagePlugin.py(213): l.append(self.i32(data, i), self.i32(data, i+4)) .\PIL\TiffImagePlugin.py(491): self.tile.append( .\PIL\TiffImagePlugin.py(510): self.tile.append( adding extra () around the append arguments will fix this. From Adeniyi Adebowale Oke" I am still having a lot of problems. I cannot include gif or jpeg image inside a frame using Label. I continue to have this problem as shown below. Can anyone please help me? Traceback (innermost last): File "C:\PROGRA~1\PYTHON\TOOLS\IDLE\ScriptBinding.py", line 131, in run_module_event execfile(filename, mod.__dict__) File "C:\TEMP\Examples\AppB\canvas.py", line 20, in ? img = PhotoImage(file='img52.gif') File "C:\Program Files\Python\Lib\lib-tk\Tkinter.py", line 1874, in __init__ apply(Image.__init__, (self, 'photo', name, cnf, master), kw) File "C:\Program Files\Python\Lib\lib-tk\Tkinter.py", line 1839, in __init__ self.tk.call(('image', 'create', imgtype, name,) + options) TclError: can't invoke "image" command: application has been destroyed Also, about the installation of Python Imaging Library, i am very confused because it is not working properly. Please can you give me hints about this. Niyi From rob@hooft.net Thu Apr 13 11:03:55 2000 From: rob@hooft.net (Rob W. W. Hooft) Date: Thu, 13 Apr 2000 12:03:55 +0200 (CEST) Subject: [Image-SIG] Followup In-Reply-To: <14580.21628.542692.947192@temoleh.chem.uu.nl> References: <14580.21628.542692.947192@temoleh.chem.uu.nl> Message-ID: <14581.39819.250839.602483@temoleh.chem.uu.nl> >>>>> "RWWH" == Rob W W Hooft writes: RWWH> Hm. I did make a stupid mistake: tkimage was using the wrong RWWH> version of tcl/tk. I fixed that now, and also made the Tcl/Tk RWWH> libraries statically linked. The python program still crashes RWWH> in the same line, with a different stack trace. Another followup: never change 2 things at a time. It does work if I use dynamically linked Tcl/Tk libraries, and recompile everything from scratch. This approach is much better anyway; otherwise I'm using 2 copies of the tcl/tk libraries: one linked into _tkinter and the other into tkimaging. I just have to add a library to my LD_LIBRARY_PATH now. Sorry for the vague reports. Rob -- ===== rob@hooft.net http://www.xs4all.nl/~hooft/rob/ ===== ===== R&D, Nonius BV, Delft http://www.nonius.nl/ ===== ===== PGPid 0xFA19277D ========================== Use Linux! ========= From scott@fleetingimage.com Thu Apr 13 19:49:23 2000 From: scott@fleetingimage.com (Scott Johnston) Date: Thu, 13 Apr 2000 11:49:23 -0700 Subject: [Image-SIG] libtiff plugin for PIL Message-ID: <38F616B3.F89F231E@fleetingimage.com> A quick deja search of "PIL libtiff" reveals that in comp.lang.python on 1998/08/27, Fredrik mentioned: "We're working on an (optional) libtiff plugin for PIL, but there's no set date when that will be available." Has any further work gone into this? My use of PIL has been severely limited by its inability to handle RGBA tiff files. (I can convert to png, or split them into four single channel images prior to import, but this is messy.) Also, has any thought been given to supporting 16-bpp data? I currently filter my data into Numeric but would love to have the best of both worlds. From KCAZA@cymbolic.com Fri Apr 14 00:12:50 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Thu, 13 Apr 2000 16:12:50 -0700 Subject: [Image-SIG] libtiff plugin for PIL Message-ID: If you're only need is RGBA, you can do a VERY quick mod of TiffImagePlugin.py that will allow them to work properly, as follows (Fred helped me with the same issue a while back): # TiffImagePlugin.py # line 101 # change (2, 1, (8,8,8,8), (0,)): ("RGBX", "RGBX"), #to: (2, 1, (8,8,8,8), (0,)): ("RGBA", "RGBA"), >>> Scott Johnston 04/13/00 11:49AM >>> A quick deja search of "PIL libtiff" reveals that in comp.lang.python on 1998/08/27, Fredrik mentioned: "We're working on an (optional) libtiff plugin for PIL, but there's no set date when that will be available." Has any further work gone into this? My use of PIL has been severely limited by its inability to handle RGBA tiff files. (I can convert to png, or split them into four single channel images prior to import, but this is messy.) Also, has any thought been given to supporting 16-bpp data? I currently filter my data into Numeric but would love to have the best of both worlds. _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From Adeniyi Adebowale Oke" I would like someone to please help me. I am using Python 1.5.2 version and I also installed PIL. Bellow is the problem. >>> import Image >>> import Tkinter >>> import ImageTk >>> im = Image.open('dive.dif') Traceback (innermost last): File "", line 1, in ? im = Image.open('dive.dif') File "C:\Program Files\Python\PIL\Image.py", line 866, in open fp = __builtin__.open(fp, "rb") IOError: [Errno 2] No such file or directory: 'dive.dif' >>> im = Image.open('dive.gif') >>> im = ImageTk.PhotoImage(im) Traceback (innermost last): File "", line 1, in ? im = ImageTk.PhotoImage(im) File "C:\Program Files\Python\PIL\ImageTk.py", line 83, in __init__ self.__photo = apply(Tkinter.PhotoImage, (), kw) File "C:\Program Files\Python\Lib\lib-tk\Tkinter.py", line 1874, in __init__ apply(Image.__init__, (self, 'photo', name, cnf, master), kw) File "C:\Program Files\Python\Lib\lib-tk\Tkinter.py", line 1839, in __init__ self.tk.call(('image', 'create', imgtype, name,) + options) TclError: can't invoke "image" command: application has been destroyed >>> I just want to use the Display the image in the Label Widget but unfortunately, it seems to be crashing anytime i dear to to that. Thanks for your urgent response. Niyi From fredrik@pythonware.com Fri Apr 14 14:00:14 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Fri, 14 Apr 2000 15:00:14 +0200 Subject: [Image-SIG] Problem with PIL -Subscribe References: <000d01bfa5af$831f7540$af81a8c0@oke.sask.trlabs.ca> Message-ID: <000701bfa611$60a4c850$0500a8c0@secret.pythonware.com> Adeniyi Adebowale Oke wrote: > TclError: can't invoke "image" command: application has been = destroyed > >>> >=20 > I just want to use the Display the image in the Label Widget but > unfortunately, it seems to be crashing anytime i dear to to that. try creating the label widget before you create the image. From fredrik@pythonware.com Fri Apr 14 14:15:42 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Fri, 14 Apr 2000 15:15:42 +0200 Subject: [Image-SIG] libtiff plugin for PIL References: <38F616B3.F89F231E@fleetingimage.com> Message-ID: <001b01bfa613$89d1a2f0$0500a8c0@secret.pythonware.com> scott wrote: > A quick deja search of "PIL libtiff" reveals that > in comp.lang.python on 1998/08/27, Fredrik mentioned: >=20 > "We're working on an (optional) libtiff plugin for PIL, > but there's no set date when that will be available." >=20 > Has any further work gone into this? yes, but the above statement still applies... > My use of PIL has been severely limited by its inability to handle > RGBA tiff files. are you using PhotoShop, and PIL opens the files as "RGBX"? if so, it's photoshop's inability to generate valid RGBA files, not PIL's inability to read them... ;-) see kevin's mail for a workaround. > Also, has any thought been given to supporting 16-bpp data? > I currently filter my data into Numeric but would love > to have the best of both worlds. PIL has (undocumented, experimental, and rather limited) support for 16 bit images (see the CHANGES file for details). there are patches out there that adds more extensive support. searching the image-sig archives may help you find them. From kcazabon" <001801bfa623$983c0640$16107118@rct1.bc.wave.home.com> <20000414132254.A5271@vislab.epa.gov> Message-ID: <001101bfa676$3cf7fca0$16107118@rct1.bc.wave.home.com> The script to convert BDF files to PIL format is available in the standard distribution (PilFont.py). I modified it a bit to automate it for my purposes though. The 'real' trick was getting all my fonts into BDF format first. To do that, I purchased a program called "FonMaker" that converts Windows fonts (Type 1 and TT) to BDF. It's $99 USD, available at http://www.fontlab.com. I have a HUGE library of Windows fonts, but converting them will just take too much space. Kevin. ----- Original Message ----- From: "Randall Hopper" To: "kcazabon" Sent: Friday, April 14, 2000 10:22 AM Subject: Re: PIL-compatible fonts -- 200dpi, 250dpi, 300dpi, ...and beyond > I'm downloading now. > > Some of these are pretty large files. Rather than archive them, would you > care to share your script so that they could be generated on the fly? Or > is that something you'd rather not do. > > Thanks, > > Randall > > > kcazabon: > |Piers Lauder was kind enough to provide FTP space for the packages I > |created. They're available at: > | > |http://www.cs.usyd.edu.au/~piers/python/pilfonts.html > | > |----- Original Message ----- > |From: "Randall Hopper" > |To: > |Sent: Friday, April 14, 2000 6:00 AM > |Subject: PIL-compatible fonts -- 200dpi, 250dpi, 300dpi, ...and beyond > | > | > |> I'd be very interesting in a copy of those: > |> > |> 200dpi, 250dpi, 300dpi, 305dpi, 400dpi, and 406dpi > |> > |> and any/all otthers you have available: From aa8vb@yahoo.com Sat Apr 15 14:36:22 2000 From: aa8vb@yahoo.com (Randall Hopper) Date: Sat, 15 Apr 2000 09:36:22 -0400 Subject: [Image-SIG] Re: PIL-compatible fonts -- 200dpi, 250dpi, 300dpi, ...and beyond In-Reply-To: <001101bfa676$3cf7fca0$16107118@rct1.bc.wave.home.com> References: <20000414090054.A2169@vislab.epa.gov> <001801bfa623$983c0640$16107118@rct1.bc.wave.home.com> <20000414132254.A5271@vislab.epa.gov> <001101bfa676$3cf7fca0$16107118@rct1.bc.wave.home.com> Message-ID: <20000415093622.A98723@vislab.epa.gov> Ok. Makes sense. You know I was thinking last night. XFree86 (the X distribution that's provided with FreeBSD, Linux, etc.) now provides true-type-capable X servers that'll use TrueType font files directly. With these X servers, you can use TTFs just as you can conventional X fonts. For example, I use the Verdana TTF in Netscape under FreeBSD for web browsing. Since with X you can render fonts into off-screen pixmaps, I wonder if anyone has built (or has thought of building) a Python-/PIL- back-end to interface with the standard X font API? ...or maybe this is already supported. (I'm just now starting to use PIL, so I don't know.) Thanks again for the TTF conversions, Kevin. -- Randall Hopper aa8vb@yahoo.com kcazabon: |The script to convert BDF files to PIL format is available in the standard |distribution (PilFont.py). I modified it a bit to automate it for my |purposes though. The 'real' trick was getting all my fonts into BDF format |first. | |To do that, I purchased a program called "FonMaker" that converts Windows |fonts (Type 1 and TT) to BDF. It's $99 USD, available at |http://www.fontlab.com. I have a HUGE library of Windows fonts, but |converting them will just take too much space. | |Randall Hopper: |> |> Some of these are pretty large files. Rather than archive them, would you |> care to share your script so that they could be generated on the fly? Or |> is that something you'd rather not do. |> |> kcazabon: |> |Piers Lauder was kind enough to provide FTP space for the packages I |> |created. They're available at: |> | |> |http://www.cs.usyd.edu.au/~piers/python/pilfonts.html From kcazabon" <001801bfa623$983c0640$16107118@rct1.bc.wave.home.com><20000414132254.A5271@vislab.epa.gov><001101bfa676$3cf7fca0$16107118@rct1.bc.wave.home.com> <20000415093622.A98723@vislab.epa.gov> Message-ID: <002701bfa6fc$773821c0$16107118@rct1.bc.wave.home.com> Actually, a week or two ago, Joerg Baumann posted a patch for PIL that allowed you to use the FreeType2 engine to render fonts into PIL format on-the-fly. This, I see as the perfect solution, once FreeType2 is buildable on all major platforms. Fred: is there any problem building that patch into PIL, with whatever modifications necessary to allow you to load the FreeType2 library from a configurable directory (or maybe just somewhere on the system path or PythonPath? Currently, that library is only supported on Linux, although I havent tried building it myself. Kevin. ----- Original Message ----- From: "Randall Hopper" To: "kcazabon" Cc: Sent: Saturday, April 15, 2000 6:36 AM Subject: Re: PIL-compatible fonts -- 200dpi, 250dpi, 300dpi, ...and beyond > Ok. Makes sense. > > You know I was thinking last night. XFree86 (the X distribution that's > provided with FreeBSD, Linux, etc.) now provides true-type-capable X > servers that'll use TrueType font files directly. > > With these X servers, you can use TTFs just as you can conventional X > fonts. For example, I use the Verdana TTF in Netscape under FreeBSD for > web browsing. > > Since with X you can render fonts into off-screen pixmaps, I wonder if > anyone has built (or has thought of building) a Python-/PIL- back-end to > interface with the standard X font API? > > ...or maybe this is already supported. (I'm just now starting to use PIL, > so I don't know.) > > Thanks again for the TTF conversions, Kevin. > > -- > Randall Hopper > aa8vb@yahoo.com > > kcazabon: > |The script to convert BDF files to PIL format is available in the standard > |distribution (PilFont.py). I modified it a bit to automate it for my > |purposes though. The 'real' trick was getting all my fonts into BDF format > |first. > | > |To do that, I purchased a program called "FonMaker" that converts Windows > |fonts (Type 1 and TT) to BDF. It's $99 USD, available at > |http://www.fontlab.com. I have a HUGE library of Windows fonts, but > |converting them will just take too much space. > | > |Randall Hopper: > |> > |> Some of these are pretty large files. Rather than archive them, would you > |> care to share your script so that they could be generated on the fly? Or > |> is that something you'd rather not do. > |> > |> kcazabon: > |> |Piers Lauder was kind enough to provide FTP space for the packages I > |> |created. They're available at: > |> | > |> |http://www.cs.usyd.edu.au/~piers/python/pilfonts.html From jknash@llnl.gov Wed Apr 19 19:45:50 2000 From: jknash@llnl.gov (Jeff Nash) Date: Wed, 19 Apr 2000 11:45:50 -0700 Subject: [Image-SIG] Use of FFT with PIL objects?? Message-ID: I'm intend to use PIL to view and manipulate images. My question is how to use 2D FFT techniques on the image objects created by, e.g. im = Image.open("imagefile.psd") ?? It would be very convenient to use the FFT routines implemented in the Numeric package. I expect I'd have to create a 2D 'array' object from 'im', unless by great good fortune the Numeric package is already familiar with Image objects (unlikely I'd guess). That suggests I'd need to extract the data from the image object. Any good suggestions on how to proceed here? If anyone has a different way to accomplish this I'd be very interested. Thanks for your help. Jeff Nash Lawrence Livermore National Laboratory jknash@llnl.gov From robert.klimek@grc.nasa.gov Thu Apr 20 18:53:53 2000 From: robert.klimek@grc.nasa.gov (Bob Klimek) Date: Thu, 20 Apr 2000 13:53:53 -0400 Subject: [Image-SIG] Use of FFT with PIL objects?? References: Message-ID: <38FF4431.3269A6AE@grc.nasa.gov> Jeff Nash wrote: > > I'm intend to use PIL to view and manipulate images. My question is how to > use 2D FFT techniques on the image objects created by, e.g. im = > Image.open("imagefile.psd") ?? > > It would be very convenient to use the FFT routines implemented in the > Numeric package. I expect I'd have to create a 2D 'array' object from > 'im', unless by great good fortune the Numeric package is already familiar > with Image objects (unlikely I'd guess). That suggests I'd need to extract > the data from the image object. > > Any good suggestions on how to proceed here? If anyone has a different way > to accomplish this I'd be very interested. > Jeff, I don't know for sure since I've never done it but from what I know of Numeric Python (NumPy), it should be fairly easy. Since I doubt that NumPy understands PIL image format, you'll have to convert the image to a linear array of integers and then read it into NumPy. To convert PIL image to a list of integers, do: d = img.getdata() and then read "d" into NumPy using array call. Convert it to a 2-d array. For color images you'll probably have to split the image into r,g,b planes first. Bob -- --------------------- Robert B. Klimek NASA Glenn Research Center robert.klimek@grc.nasa.gov --------------------- From rob@hooft.net Tue Apr 25 08:36:43 2000 From: rob@hooft.net (Rob W. W. Hooft) Date: Tue, 25 Apr 2000 09:36:43 +0200 (CEST) Subject: [Image-SIG] Use of FFT with PIL objects?? In-Reply-To: <38FF4431.3269A6AE@grc.nasa.gov> References: <38FF4431.3269A6AE@grc.nasa.gov> Message-ID: <14597.19211.863225.53119@temoleh.chem.uu.nl> >>>>> "BK" == Bob Klimek writes: >> It would be very convenient to use the FFT routines implemented in >> the Numeric package. I expect I'd have to create a 2D 'array' >> object from 'im', unless by great good fortune the Numeric package >> is already familiar with Image objects (unlikely I'd guess). That >> suggests I'd need to extract the data from the image object. BK> Since I doubt that NumPy understands PIL image format, you'll BK> have to convert the image to a linear array of integers and then BK> read it into NumPy. I think it is a better idea to use im.tostring() and the Numpy fromstring() routines. Twhere is currently no direct connection between the two packages. Rob -- ===== rob@hooft.net http://www.xs4all.nl/~hooft/rob/ ===== ===== R&D, Nonius BV, Delft http://www.nonius.nl/ ===== ===== PGPid 0xFA19277D ========================== Use Linux! ========= From jknash@llnl.gov Tue Apr 25 16:34:03 2000 From: jknash@llnl.gov (Jeff Nash) Date: Tue, 25 Apr 2000 08:34:03 -0700 Subject: [Image-SIG] Use of FFT with PIL objects?? Message-ID: Les Schaffer sent me some code which does a data transfer to and from PIL data structures using the tostring / fromstring functions. It works very well and I'm playing with it now. Transfer to Numeric is easy from that point. I was not aware previous to this that PIL is internally oriented around 8 bit pixel values. I'm interested in working with 12 bit grayscale scanned images at very high resolution. For the moment my scans are still at the 8 bit level so I can use the present implementations, but I wonder about how to proceed once I have the higher bit depth. Adobe Photoshop has very limited capability at greater than 8 bit depth, so PIL looked like a good path - especially since I have numeric processing in mind. Does anyone have a solution to this? Thanks everyone for the useful suggestions! This SIG is a very good resource for beginning / occasional users. Jeff Nash