From rm1@student.cs.ucc.ie Wed Feb 2 18:28:23 2000 From: rm1@student.cs.ucc.ie (Robert Moloney) Date: Wed, 2 Feb 2000 18:28:23 +0000 (GMT) Subject: [Image-SIG] How can I get Python to recognise the ijg jpeg libraries? Message-ID: Hi, How can I get Python to recognise the ijg jpeg libraries? I have Suse linux 6.1 I used RPM files to install PIL and Python. The IJG Jpeg libraries were alreay on the machine. When I try to manipulate a jpeg file it gives a decode error -2. When I do a dir(_imaging) jpeg_decoder and jpeg_encoder appear in the list. Cheers Rob From hannu@tm.ee Wed Feb 2 23:01:35 2000 From: hannu@tm.ee (Hannu Krosing) Date: Thu, 03 Feb 2000 01:01:35 +0200 Subject: [Image-SIG] How can I get Python to recognise the ijg jpeg libraries? References: Message-ID: <3898B74F.B348F842@tm.ee> Robert Moloney wrote: > > Hi, > > How can I get Python to recognise the ijg jpeg libraries? > > I have Suse linux 6.1 I used RPM files to install PIL and Python. > The IJG Jpeg libraries were alreay on the machine. When I try to > manipulate a jpeg file it gives a decode error -2. When I do a > dir(_imaging) jpeg_decoder and jpeg_encoder appear in the list. > There seems to be something wrong with rpm-s ;( I had to solve the same problem yesterday for using Zope's Photo product. I did it on RH6.1 That's what I had to do. download the PIL 1.0 tar.gz from it's homesite extract it cd libImaging ./configure make cd .. make -f Makefile.pre.in.boot If you don't want TK support or there are conflicts (as I had) then edit the resulting Makefile and remove all references to tkImaging and other tcl/tk stuff (just uncommenting it from Setup.in won't work, complains about *noobject* somewhere) copy the stuff to /usr/lib/python1.5/site-packages/PIL as instructed by README. It could be wise to run python -c "import compileall;compile_dir('/usr/lib/python1.5/site-packages/PIL')" to compile all the python modules in PIL while you are root ----------------- Hannu From piers@cs.su.oz.au Fri Feb 4 10:03:31 2000 From: piers@cs.su.oz.au (Piers Lauder) Date: Fri, 04 Feb 2000 21:03:31 +1100 Subject: [Image-SIG] problem with PIDDLE and PIL Message-ID: <200002041010.FAA25996@python.org> When installing PIDDLE and running its built-in test suite, I encountered an error Traceback from within PIL (VERSION=1.0): # s piddle ; python piddletest.py 1. piddleAI A. minimal 2. piddleGL B. basics 3. piddlePDF C. advanced 4. piddlePIL D. spectrum 5. piddlePS E. strings 6. piddleQD F. rotstring 7. piddleTK 8. piddleVCR Selection (0 to exit): 4A piddlePIL This module implements a Python Imaging Library PIDDLE canvas. In other words, this is a PIDDLE backend that renders into a PIL Image object. From there, you can save as GIF, plot into another PIDDLE canvas, etc. Joe Strout (joe@strout.net), 10/26/99 Just a very basic test of line drawing and canvas size. Traceback (innermost last): File "piddletest.py", line 273, in ? mainLoop() File "piddletest.py", line 268, in mainLoop runtest(backends[backend], tests[test]) File "piddletest.py", line 210, in runtest canvas = testfunc(canvasClass) File "piddletest.py", line 22, in minimal canvas.drawLine(1,1,size[0]-1,size[1]-1) File "piddlePIL.py", line 247, in drawLine self._pen.line( (x1,y1), (x2,y2) ) File "/local/usr/lib/python1.5/site-packages/PIL/ImageDraw.py", line 107, in line ink, fill = self._getink(fill) File "/local/usr/lib/python1.5/site-packages/PIL/ImageDraw.py", line 73, in _getink ink = self.im.draw_ink(ink) TypeError: illegal argument type for built-in operation Looking at the source involved, _getink is defined as: def _getink(self, ink, fill=None): but there are calls to _getink of the form (lines 106,107): def line(self, xy, fill=None): ink, fill = self._getink(fill) I may well be wrong - but shouldn't line 107 read: ink, fill = self._getink(fill=fill) If I'm way off beam here, I'd be very grateful for pointers on where else to look... Thanks, Piers Lauder. From fredrik@pythonware.com Fri Feb 4 13:01:15 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Fri, 4 Feb 2000 14:01:15 +0100 Subject: [Image-SIG] Python Imaging References: <86.81e075.25c742e5@aol.com> Message-ID: <022801bf6f0f$f1b644b0$f29b12c2@secret.pythonware.com> Rosshop@aol.com wrote: > I downloaded python imaging and i don't understand how to get an image = > embeded into python to use. Can you help me out??? not sure what you mean by "embedded"... the usual way is to load images from disk, as described in the PIL tutorial. to embed images to python source code, you can convert them to strings using a suitable method (e.g. base64), and use the StringIO module to handle those strings like files. also see the image2py.py sample in the Scripts directory which converts an image to python source code, using that technique. From kuncej@mail.conservation.state.mo.us Fri Feb 4 18:53:34 2000 From: kuncej@mail.conservation.state.mo.us (Jeffrey Kunce) Date: Fri, 04 Feb 2000 12:53:34 -0600 Subject: [Image-SIG] problem with PIDDLE and PIL Message-ID: >When installing PIDDLE and running its built-in test suite, I encountered >an error Traceback from within PIL (VERSION=3D1.0): The below is from the piddle mailing list archives=20 (http://www.egroups.com/group/pythonpiddle).=20 I think it will fix your problem. --Jeff ---------------------------------------------------------------------------= --------------------------------- Hey all, I just discovered Piddle, and decided to use it to help manage my site.. I need a bunch of simple graphics to all look alike, but use different colors.. I tried using PIL, but the docs just didn't suit my needs.. Then I found Piddle, and it rocks.. so thanks! I hope this is the right place to put this.. If not, sorry. :) I've got a *very* minor patch to piddlePIL.py... starting line 246: if Image.VERSION <=3D "1.0": self._pen.line( ((x1,y1), (x2,y2)) )=09 elif Image.VERSION <=3D "1.0b1": self._pen.line( (x1,y1), (x2,y2) ) else: self._pen.line(x1,y1,x2,y2) ... basically, PIL version 1.0 changed (again) the way they do line coordinates, and this prevented you from drawing lines or outlines if you had that version of PIL. This seems to fix it.. -Michal http://www.linkwatcher.com/metalog/ From piers@cs.su.oz.au Fri Feb 4 21:03:46 2000 From: piers@cs.su.oz.au (Piers Lauder) Date: Sat, 05 Feb 2000 08:03:46 +1100 Subject: [Image-SIG] problem with PIDDLE and PIL References: Message-ID: <949698677.382.310298476@cs.usyd.edu.au> Hi! Thanks for your reply: On Fri, 04 Feb 2000 12:53:34 -0600, Jeffrey Kunce wrote: > > >When installing PIDDLE and running its built-in test suite, I encountered > >an error Traceback from within PIL (VERSION=1.0): > > The below is from the piddle mailing list archives > (http://www.egroups.com/group/pythonpiddle). > I think it will fix your problem. > > ... > > I hope this is the right place to put this.. If not, sorry. :) > I've got a *very* minor patch to piddlePIL.py... starting line 246: > > if Image.VERSION <= "1.0": > self._pen.line( ((x1,y1), (x2,y2)) ) > elif Image.VERSION <= "1.0b1": > self._pen.line( (x1,y1), (x2,y2) ) > else: > self._pen.line(x1,y1,x2,y2) I'd already searched the PIDDLE mailing lists archives and applied this patch (and you'll see it in use in the trace I supplied, at the line ``File "piddlePIL.py", line 247, in drawLine'' below). Traceback (innermost last): File "piddletest.py", line 273, in ? mainLoop() File "piddletest.py", line 268, in mainLoop runtest(backends[backend], tests[test]) File "piddletest.py", line 210, in runtest canvas = testfunc(canvasClass) File "piddletest.py", line 22, in minimal canvas.drawLine(1,1,size[0]-1,size[1]-1) File "piddlePIL.py", line 247, in drawLine self._pen.line( (x1,y1), (x2,y2) ) File "/local/usr/lib/python1.5/site-packages/PIL/ImageDraw.py", line 107, in line ink, fill = self._getink(fill) File "/local/usr/lib/python1.5/site-packages/PIL/ImageDraw.py", line 73, in _getink ink = self.im.draw_ink(ink) TypeError: illegal argument type for built-in operation So am I right in assuming this is a different problem? From piers@cs.su.oz.au Fri Feb 4 21:12:14 2000 From: piers@cs.su.oz.au (Piers Lauder) Date: Sat, 05 Feb 2000 08:12:14 +1100 Subject: [Image-SIG] problem with PIDDLE and PIL References: Message-ID: <949698807.06.333739501@cs.usyd.edu.au> OOPS - My apologies - I see I applied the patch incorrectly! All works now. On Fri, 04 Feb 2000 12:53:34 -0600, Jeffrey Kunce wrote: > > >When installing PIDDLE and running its built-in test suite, I encountered > >an error Traceback from within PIL (VERSION=1.0): > > The below is from the piddle mailing list archives > (http://www.egroups.com/group/pythonpiddle). > I think it will fix your problem. It does :-) From jmr@everest.radiology.uiowa.edu Sun Feb 6 04:16:01 2000 From: jmr@everest.radiology.uiowa.edu (Joe Reinhardt) Date: 05 Feb 2000 22:16:01 -0600 Subject: [Image-SIG] Troubles with ellipses Message-ID: <87aelfufsu.fsf@davinci.radiology.uiowa.edu> --=-=-= I am trying to draw an ellipse onto a PIL canvas. I wasn't able to find much documentation on the ImageDraw.ellipse method, but I think I properly determined the order of arguments to specify the major and minor axes. My trouble is that one of the axes is coming out a bit too short. Attached below is an example. I was expecting to see an ellipse exactly inscribing the rectangle. However, the bottom edge is off by one pixel. Any ideas? --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=el.py Content-Description: Ellipse test code # # ellipse test # import Image, ImageDraw size = 255 r1 = 40 r2 = 55 center = (size - 1)/2 im = Image.new("L", (size, size)) draw = ImageDraw.Draw(im) print "center = " + `center` print `[center - r1, center - r2, center + r1, center + r2]` draw.rectangle([center - r1, center - r2, center + r1, center + r2], 255) draw.ellipse([center - r1, center - r2, center + r1, center + r2], 150) im.show() --=-=-= -- Joseph M. Reinhardt joe-reinhardt@uiowa.edu Department of Biomedical Engineering 1402 Seamans Center University of Iowa Iowa City, IA 52242 Phone: 319-335-5634 Fax: 319-335-5631 --=-=-=-- From ALavizzio@quark.com Mon Feb 7 17:05:28 2000 From: ALavizzio@quark.com (Alden Lavizzo) Date: Mon, 7 Feb 2000 10:05:28 -0700 Subject: [Image-SIG] Future of PIL Message-ID: <3D62AB6FFC80D211A84700104B10CB2C025D8CAB@denver.quark.com> I'm curious about the future development of PIL. What are the major things we can expect in the next couple of years? (e.g., Is there work towards version 2, and if so, what are the main features being developed? Is it possible that the licensing agreement could change in future versions?) I remember reading somewhere that a commercial version of PIL is in development. Is this the same thing as PIL Plus? (If yes, ignore the following questions). Will this replace the current, free version now available (as far as future development and maintenance are concerned)? Could I get an estimate of how much would be charged for it? I have these concerns because PIL is being considered for commercial use. How feasible this is depends on these questions. I am aware of PIL Plus, and would also like to know how that fits into the equation (or if that is the simple answer to all these questions...). Thanks, Alden Lavizzo From robert.klimek@grc.nasa.gov Mon Feb 7 19:58:02 2000 From: robert.klimek@grc.nasa.gov (Bob Klimek) Date: Mon, 07 Feb 2000 14:58:02 -0500 Subject: [Image-SIG] Future of PIL References: <3D62AB6FFC80D211A84700104B10CB2C025D8CAB@denver.quark.com> Message-ID: <389F23CA.5B062F21@grc.nasa.gov> Hello, I've been wondering this my self. Bob Alden Lavizzo wrote: > > I'm curious about the future development of PIL. What are the major things > we can expect in the next couple of years? (e.g., Is there work towards > version 2, and if so, what are the main features being developed? Is it > possible that the licensing agreement could change in future versions?) > > I remember reading somewhere that a commercial version of PIL is in > development. Is this the same thing as PIL Plus? (If yes, ignore the > following questions). Will this replace the current, free version now > available (as far as future development and maintenance are concerned)? > Could I get an estimate of how much would be charged for it? > > I have these concerns because PIL is being considered for commercial use. > How feasible this is depends on these questions. I am aware of PIL Plus, > and would also like to know how that fits into the equation (or if that is > the simple answer to all these questions...). > > Thanks, > Alden Lavizzo > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://www.python.org/mailman/listinfo/image-sig -- --------------------- Robert B. Klimek NASA Glenn Research Center robert.klimek@grc.nasa.gov --------------------- From fredrik@pythonware.com Tue Feb 8 17:37:39 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Tue, 8 Feb 2000 18:37:39 +0100 Subject: [Image-SIG] Future of PIL References: <3D62AB6FFC80D211A84700104B10CB2C025D8CAB@denver.quark.com> Message-ID: <005f01bf725b$33671fd0$f29b12c2@secret.pythonware.com> > I'm curious about the future development of PIL. What are the major = things > we can expect in the next couple of years? (e.g., Is there work = towards > version 2, and if so, what are the main features being developed? Is = it > possible that the licensing agreement could change in future = versions?) future versions of the standard PIL distribution ("the core") will have the same license (or a compatible one; we'll track the standard Python license as close as we possibly can). as for new releases, we'll release a maintenance release (1.0.1) soon. there will definitely be more releases of the core, but there are no fixed plans (in other words, I'm open for suggestions). > I remember reading somewhere that a commercial version of PIL is in > development. Is this the same thing as PIL Plus? (If yes, ignore the > following questions). Will this replace the current, free version now > available (as far as future development and maintenance are = concerned)? nope. the core will always be free. commercial stuff will be layered on top of the core, not replace it. the current PIL Plus release contains a bunch of additional bits and pieces, and is currently only available for support customers: http://www.pythonware.com/products/pil/support.htm From Barry McInnes Tue Feb 8 20:38:10 2000 From: Barry McInnes (Barry McInnes) Date: Tue, 8 Feb 2000 13:38:10 -0700 (MST) Subject: [Image-SIG] SOlaris 2.7 problems Message-ID: <200002082038.NAA06676@cdc.noaa.gov> Hi, I have tried making Image PIL under Solaris 2.7 with ccc version 5 and gcc 2.95.2 and I keep getting the same problem, testing with python 1.5.2 lorenz{root} 277: setenv PYTHONPATH .:./PIL lorenz{root} 278: python Python 1.5.2 (#2, Feb 8 2000, 10:27:03) [GCC 2.95.2 19991024 (release)] on sunos5 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import _imaging Traceback (innermost last): File "", line 1, in ? ImportError: ld.so.1: python: fatal: relocation error: file ./_imaging.so: symbol XKeycodeToKeysym: referenced symbol not found >>> ^D lorenz{root} 279: any help appreciated. This code works on our Linux box (Red Hat), thanks barry ------ Barry Mc Innes Email: bjm@cdc.noaa.gov Phone: 303-4976231 FAX: 303-4977013 Smail: NOAA-CIRES CDC, Mail Code: R/CDC1 325 Broadway, Boulder CO 80303-3328 ------ From wycrutchfield@lbl.gov Wed Feb 9 18:23:59 2000 From: wycrutchfield@lbl.gov (William Y. Crutchfield) Date: Wed, 09 Feb 2000 10:23:59 -0800 Subject: [Image-SIG] bug is PSDraw.py Message-ID: <38A1B0BF.36D2C7A7@mothra.lbl.gov> in PIL 1.0 distribution: class PSDraw method image() has a line self.fp.write("gsize\n%f %f translate\n" % (dx, dy)) which apparently wants to be self.fp.write("gsave\n%f %f translate\n" % (dx, dy)) At least that's what the comments at the top of the file indicate..... From joshua.kifer@supplysolution.com Wed Feb 16 19:23:28 2000 From: joshua.kifer@supplysolution.com (Joshua Kifer) Date: Wed, 16 Feb 2000 11:23:28 -0800 (PST) Subject: [Image-SIG] Documentation Message-ID: Is there documentation other than the Draft (1999-02-12) that details all or part of the PIL API? --- Joshua Kifer Web Design Programmer SupplySolution.com From dl231@eng.cam.ac.uk Thu Feb 17 17:18:54 2000 From: dl231@eng.cam.ac.uk (D. Lopez-De-Ipina) Date: Thu, 17 Feb 2000 17:18:54 +0000 (GMT) Subject: [Image-SIG] Question from a newbie Message-ID: Hi, I have just started today having a look to PIL, I need to display an image composed by a matrix of greyscale values saved to a file. The file contains one line for each image pixel row and separates each pixel's greyscale value by an space. I have been trying for a while to modify the example Scripts/viewer.py to create a new image using method Image.fromstring. However, I haven't had much success yet. I know it must have been a very silly and simple mistake but I can not see it. What I do is the following: imageFile = open(filename) data = array.array("i") for iRow in range(240): dataLine = imageFile.readline() for iCol in range(320): iPos = string.find(dataLine, " ") data.append(int(dataLine[:iPos])) dataLine = dataLine[iPos+1:] im = Image.fromstring("L", (320,240), data ) imageFile.close() UI(root, im).pack() root.mainloop() If anybody could point out what I have done wrong I would be very grateful. Regards, Diego From KCAZA@cymbolic.com Thu Feb 17 17:41:31 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Thu, 17 Feb 2000 09:41:31 -0800 Subject: [Image-SIG] Question from a newbie Message-ID: How about something simpler... ######### import string, Image, array file = open(filename, 'r') text = file.readlines() file.close() text = string.split(text) #defaults to splitting on any white space, returning a list data = array.array('B', text).tostring() datasize = (320,240) im = Image.fromstring('L', datasize, data) ########### >>> "D. Lopez-De-Ipina" 02/17/00 09:18AM >>> Hi, I have just started today having a look to PIL, I need to display an image composed by a matrix of greyscale values saved to a file. The file contains one line for each image pixel row and separates each pixel's greyscale value by an space. I have been trying for a while to modify the example Scripts/viewer.py to create a new image using method Image.fromstring. However, I haven't had much success yet. I know it must have been a very silly and simple mistake but I can not see it. What I do is the following: imageFile = open(filename) data = array.array("i") for iRow in range(240): dataLine = imageFile.readline() for iCol in range(320): iPos = string.find(dataLine, " ") data.append(int(dataLine[:iPos])) dataLine = dataLine[iPos+1:] im = Image.fromstring("L", (320,240), data ) imageFile.close() UI(root, im).pack() root.mainloop() If anybody could point out what I have done wrong I would be very grateful. Regards, Diego _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From KCAZA@cymbolic.com Thu Feb 17 17:53:17 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Thu, 17 Feb 2000 09:53:17 -0800 Subject: [Image-SIG] Question from a newbie Message-ID: oops... forgot a little thing: after the string.split(), you need to convert the string values to integers before doing the array. ######## import string, Image, array file = open(filename, 'r') text = file.readlines() file.close() text = string.split(text) #defaults to splitting on any white space, returning a list for i in range (len(text)): #this is the addition, sorry! text[i] = string.atoi(text[i]) data = array.array('B', text).tostring() datasize = (320,240) im = Image.fromstring('L', datasize, data) im.save(yourfilename, "TIF") >>> Kevin Cazabon 02/17/00 09:41AM >>> How about something simpler... ######### import string, Image, array file = open(filename, 'r') text = file.readlines() file.close() text = string.split(text) #defaults to splitting on any white space, returning a list data = array.array('B', text).tostring() datasize = (320,240) im = Image.fromstring('L', datasize, data) ########### >>> "D. Lopez-De-Ipina" 02/17/00 09:18AM >>> Hi, I have just started today having a look to PIL, I need to display an image composed by a matrix of greyscale values saved to a file. The file contains one line for each image pixel row and separates each pixel's greyscale value by an space. I have been trying for a while to modify the example Scripts/viewer.py to create a new image using method Image.fromstring. However, I haven't had much success yet. I know it must have been a very silly and simple mistake but I can not see it. What I do is the following: imageFile = open(filename) data = array.array("i") for iRow in range(240): dataLine = imageFile.readline() for iCol in range(320): iPos = string.find(dataLine, " ") data.append(int(dataLine[:iPos])) dataLine = dataLine[iPos+1:] im = Image.fromstring("L", (320,240), data ) imageFile.close() UI(root, im).pack() root.mainloop() If anybody could point out what I have done wrong I would be very grateful. Regards, Diego _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From mmiller3@iupui.edu Thu Feb 17 20:08:29 2000 From: mmiller3@iupui.edu (Mike Miller) Date: 17 Feb 2000 14:08:29 -0600 Subject: [Image-SIG] Question from a newbie In-Reply-To: Kevin Cazabon's message of "Thu, 17 Feb 2000 09:53:17 -0800" References: Message-ID: <76vh3ny4le.fsf@zilch.npl.uiuc.edu> A couple of small corrections... file.readlines returns a list of lines, each of which would have to be split separately. It is simpler to do a file.read(), which returns one long string. >>> import string, Image, array >>> >>> file = open('test.txt', 'r') >>> >>> text = string.split(file.read()) >>> >>> for i in range (len(text)): ... text[i] = string.atof(text[i]) >>> >>> imdata = array.array('B', data).tostring() >>> >>> datasize = (41,41) >>> im = Image.fromstring('L', datasize, imdata) >>> >>> im.save('test.tiff', "TIFF") >>> im.show() Mike -- Michael A. Miller mmiller3@iupui.edu Krannert Institute of Cardiology, IU School of Medicine From mmiller3@iupui.edu Thu Feb 17 20:18:34 2000 From: mmiller3@iupui.edu (Mike Miller) Date: 17 Feb 2000 14:18:34 -0600 Subject: [Image-SIG] DICOM and PIL? Message-ID: <76ln4jy44l.fsf@zilch.npl.uiuc.edu> I'm about to write some rudimentary wrappers around David Clunie's Dicom3tools [1]. I'm interested in hearing from others who are using (or would like to use) python for processing DICOM files For those who are not familiar with it, DICOM (Digital Imaging and Communications in Medicine) standards are intended to "allow vendors to produce a piece of equipment or software that has a high probability of communicating with devices from other vendors." Dicom3tools is a collection of utilities for manipulating headers and images in dicom files. Mike [1] http://idt.net/~dclunie/dicom3tools.html -- Michael A. Miller mmiller3@iupui.edu Krannert Institute of Cardiology, IU School of Medicine From dl231@eng.cam.ac.uk Fri Feb 18 10:46:43 2000 From: dl231@eng.cam.ac.uk (D. Lopez-De-Ipina) Date: Fri, 18 Feb 2000 10:46:43 +0000 (GMT) Subject: [Image-SIG] Problems visualising an RGB24 image In-Reply-To: Message-ID: Hi, Today, I am experimenting a similar a problem to the one yesterday I had trying to visualise a greyscale image pixel values stored in a file into a PIL image. I solved yesterday's one, however now I don't know what I might have done wrong again. The file I read contains integer numbers in the range (0 to 2^24-1) representing the RGB24 pixel values of the image. After the code is executed and the image generated is displayed, it looks distorted. I am pretty sure the values of the pixels are correct. Here is the code used: # Visualise colour image imageFile = open(filename) data = array.array("i") for iRow in range(240): pixelList = string.split(imageFile.readline()) for iCol in range(320): data.append(eval(pixelList[iCol])) im = Image.fromstring("RGB", (320,240), data.tostring()) imageFile.close() Any help again from the mailing list would be very appreciated. Thanks, Diego From KCAZA@cymbolic.com Fri Feb 18 17:10:43 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Fri, 18 Feb 2000 09:10:43 -0800 Subject: [Image-SIG] Problems visualising an RGB24 image Message-ID: The first thing I see is that you don't seem to be creating a list of RGB values, just a list of (320x240) values. You need three values for each pixel to create an RGB image, listed as [R,G,B,R,G,B,R,G,B...], totaling (320x240x3) numbers. Kevin. >>> "D. Lopez-De-Ipina" 02/18/00 02:46AM >>> Hi, Today, I am experimenting a similar a problem to the one yesterday I had trying to visualise a greyscale image pixel values stored in a file into a PIL image. I solved yesterday's one, however now I don't know what I might have done wrong again. The file I read contains integer numbers in the range (0 to 2^24-1) representing the RGB24 pixel values of the image. After the code is executed and the image generated is displayed, it looks distorted. I am pretty sure the values of the pixels are correct. Here is the code used: # Visualise colour image imageFile = open(filename) data = array.array("i") for iRow in range(240): pixelList = string.split(imageFile.readline()) for iCol in range(320): data.append(eval(pixelList[iCol])) im = Image.fromstring("RGB", (320,240), data.tostring()) imageFile.close() Any help again from the mailing list would be very appreciated. Thanks, Diego _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From joshua.kifer@supplysolution.com Fri Feb 18 18:30:46 2000 From: joshua.kifer@supplysolution.com (Joshua Kifer) Date: Fri, 18 Feb 2000 10:30:46 -0800 (PST) Subject: [Image-SIG] Anti-alias Message-ID: I'd like to do some anti-aliasing in my graphics. Can anyone give me a point of reference? --- Joshua Kifer Web Design Programmer SupplySolution.com From kcazabon" This is a multi-part message in MIME format. ------=_NextPart_000_000D_01BF7A62.52808000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit In a lot of the image processing I've needed to do, there is the need to crop and resize an image to a different aspect ratio. Doing so has been a bit of a pain, so I've written a little function that will do so for you, as well as providing a few extra capabilities. It is similar to the im.thumbnail() method, but instead of fitting entirely within the size you give, it will crop to fill the exact size you want. The method of cropping is user-definable as well (from the center, from the side, 30% from the top, whatever you want). This way (assuming my function was implemented as a method in PIL), if you had for example a 300x400 pixel image that you wanted to center-crop and resize to be 512x768 (without distorting it), you could simply use: im = im.fit((512,768)) alternatively, you could be a little more specific, setting the following options: -"method" of interpolation when resizing (0,2,3, same as in im.resize((size), method) ) -"bleed", a default amount (in decimal percent, 0.0 - 0.49999) to crop off all edges, useful for removing the edges of a scanned image that may include frame edges, etc. -"centering" to control where the crop happens, and if it's centered or biased towards cropping more from some sides than others I've attached my 'ImageFit' module that demonstrates these functions. The only difference is that the first argument needs to be a PIL image object. Feel free to try it out, and if it's easy to implement, I'd like to see it as part of the standard PIL methods. Kevin Cazabon. ------=_NextPart_000_000D_01BF7A62.52808000 Content-Type: text/plain; name="ImageFit.py" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ImageFit.py" import Image def fit(inputImage, outputSize, method=3D0, bleed=3D0.0, = centering=3D[0.50,0.50]): """=20 This method returns a sized and cropped version of the image, = cropped to the aspect ratio and size that you request. It can be customized to your needs with = "method", "bleed", and "centering" as required. =20 inputImage =3D an PIL Image object, could easily be changed to = "self" to make this a method of an Image object. outputSize =3D (width, height) in pixels of image to return method =3D resizing method: 0=3D(replication), 2=3D(bi-linear), = 3=3D(bi-cubic) bleed =3D decimal percentage (0-0.49999) of width/height to crop = off as a minumum around the outside of the image This allows you to remove a default amount of the = image around the outside, for 'cleaning up' scans that may have edges of negs = showing, or whatever. This percentage is removed from EACH side, not a = total amount. centering =3D [left, top], percentages to crop of each side to = fit the aspect ratio you require. This function allows you to customize where the crop = occurs, whether it is a=20 'center crop' or a 'top crop', or whatever. Default = is center-cropped. [0.5, 0.5] is center cropping (i.e. if cropping the = width, take 50% off of the left side (and therefore 50% off the right = side), and same with Top/Bottom) [0.0, 0.0] will crop from the top left corner (i.e. = if cropping the width, take all of the crop off of the right side, and = if cropping the height, take all of it off the bottom) [1.0, 0.0] will crop from the bottom left corner, = etc. (i.e. if cropping the width, take all of the crop off the left = side, and if cropping the height take none from the Top (and therefore = all off the bottom))=20 =20 by Kevin Cazabon, Feb 17/2000 kcazabon@home.com=20 http://members.home.com/kcazabon """ =20 # ensure inputs are valid if type(centering) !=3D type([]): centering =3D [centering[0], centering[1]] if centering[0] > 1.0 or centering[0] < 0.0: centering [0] =3D 0.50 if centering[1] > 1.0 or centering[1] < 0.0: centering[1] =3D 0.50 =20 if bleed > 0.49999 or bleed < 0.0: bleed =3D 0.0 =20 if method not in [0, 2, 3]: method =3D 0 # calculate the area to use for resizing and cropping, subtracting = the 'bleed' around the edges =20 bleedPixels =3D (int((float(bleed) * float(inputImage.size[0])) + = 0.5), int((float(bleed) * float(inputImage.size[1])) + 0.5)) # number of = pixels to trim off on Top and Bottom, Left and Right liveArea =3D (bleedPixels[0], bleedPixels[1], inputImage.size[0] - = bleedPixels[0] - 1, inputImage.size[1] - bleedPixels[1] - 1) liveSize =3D (liveArea[2] - liveArea[0], liveArea[3] - liveArea[1]) =20 # calculate the aspect ratio of the liveArea liveAreaAspectRatio =3D float(liveSize[0])/float(liveSize[1]) =20 # calculate the aspect ratio of the output image aspectRatio =3D float(outputSize[0])/float(outputSize[1]) =20 # figure out if the sides or top/bottom will be cropped off if liveAreaAspectRatio >=3D aspectRatio: # liveArea is wider than what's needed, crop the sides cropWidth =3D int((aspectRatio * float(liveSize[1])) + 0.5) cropHeight =3D liveSize[1] =20 else: #liveArea is taller than what's needed, crop the top and bottom cropWidth =3D liveSize[0] cropHeight =3D int((float(liveSize[0])/aspectRatio) + 0.5) =20 # make the crop =20 leftSide =3D int(liveArea[0] + (float(liveSize[0] - cropWidth) * = centering[0])) if leftSide < 0: leftSide =3D 0 topSide =3D int(liveArea[1] + (float(liveSize[1] - cropHeight) * = centering[1])) if topSide < 0: topSide =3D 0 =20 =20 outputImage =3D inputImage.crop((leftSide, topSide, leftSide + = cropWidth, topSide + cropHeight)) =20 # resize the image and return it =20 return outputImage.resize(outputSize, method) =20 =20 =20 =20 =20 =20 =20 =20 =20 ------=_NextPart_000_000D_01BF7A62.52808000-- From jack@oratrix.nl Fri Feb 18 23:51:49 2000 From: jack@oratrix.nl (Jack Jansen) Date: Sat, 19 Feb 2000 00:51:49 +0100 Subject: [Image-SIG] Problems visualising an RGB24 image In-Reply-To: Message by Kevin Cazabon , Fri, 18 Feb 2000 09:10:43 -0800 , Message-ID: <20000218235154.BC7FCD71E1@oratrix.oratrix.nl> For converting images with strange byte formats 'img' is still a lot stronger than pil. With img you can describe the current incore format (which in this case would be 24bit pixels with no padding, no stride) and the wanted incore format (32 bit pixels r,g,b,ignore) and it'll quickly convert the image. If someone wants to port this feature from img to pil: be my guest. This auto-conversion feature is the main reason I still use img and haven't switched to pil: on any platform with any image file I can do window = whatever-os-call-needed-to-get-a-window() format_wanted = imgformat.whatever-the-corresponding-format reader = img.reader(filename, format_wanted) bitmap = reader.read() and this will work for any combination of supported image files (from x-bitmap to png, to name two) and bitmap format (from MacOS 15-bit BGR to 1-bit b/w) and produce reasonable results. The pil bitmap format descriptions aren't strong enough for this (at least, not last time I checked), as they can't describe packing of components into pixels, stride, etc. And img will always take the fastest route from source to destination with the least information loss (well, it tries to, at least:-). But, all that said, pil has far more functionality than img, which is basically only image read/write/display plus the conversions needed for that (dithering, colormapping, pixelshifting), so merging these features from img into pil would be a great boon. Anyone interested in looking into this is invited to check img out, at ftp://ftp.cwi.nl/pub/jack/python. And if someone decides to try it let me know, as I have a much newer img locally (but never got around to packing it up again, because there seems to be so little interest in it). -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From piet@cs.uu.nl Mon Feb 21 12:08:42 2000 From: piet@cs.uu.nl (piet@cs.uu.nl) Date: Mon, 21 Feb 2000 13:08:42 +0100 (MET) Subject: [Image-SIG] PIL photocd loading Message-ID: <14513.10954.4000.306844@gargle.gargle.HOWL> Has anybody succeeded in loading photocd files with PIL? When I trie this, Python crashes with a memory access violation. This is on Windows NT with PIL 1.0 (Nov 99). import Image im = Image.open("yose05.pcd") im.show() -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP] Private email: Piet.van.Oostrum@gironet.nl Return-Path: Delivered-To: image-sig@python.org Received: from mail.cs.uu.nl (unknown [131.211.80.32]) by dinsdale.python.org (Postfix) with ESMTP id 4B46E1CFCD for ; Mon, 21 Feb 2000 11:06:24 -0500 (EST) Received: from sunshine.cs.uu.nl (sunshine.cs.uu.nl [131.211.80.33]) by mail.cs.uu.nl (Postfix) with ESMTP id D232A451A for ; Sat, 19 Feb 2000 15:30:42 +0100 (MET) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-Message-ID: <14510.43280.304266.401509@sunshine.cs.uu.nl> Resent-Date: Sat, 19 Feb 2000 15:30:40 +0100 (MET) Resent-To: image-sig@python.org Newsgroups: comp.lang.python Message-ID: Organization: Dept of Computer Science, Utrecht University, The Netherlands Lines: 12 User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.5 From: piet@cs.uu.nl Date: 18 Feb 2000 17:17:12 +0100 Resent-From: piet@cs.uu.nl Subject: [Image-SIG] PIL photocd loading Sender: image-sig-admin@python.org Errors-To: image-sig-admin@python.org X-BeenThere: image-sig@python.org X-Mailman-Version: 1.2 (beta 1) Precedence: bulk List-Id: Image Processing with Python SIG Has anybody succeeded in loading photocd files with PIL? When I trie this, Python crashes with a memory access violation. This is on Windows NT with PIL 1.0 (Nov 99). import Image im = Image.open("yose05.pcd") im.show() -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP] Private email: Piet.van.Oostrum@gironet.nl From rm1@student.cs.ucc.ie Wed Feb 23 18:39:44 2000 From: rm1@student.cs.ucc.ie (Robert Moloney) Date: Wed, 23 Feb 2000 18:39:44 +0000 (GMT) Subject: [Image-SIG] PIL JPEG Message-ID: Hi, How can I save an image as progressive jpeg I get errors when I try image1 = Image.save(image2,"JPEG",progression) Cheers Rob From jwt-python@dskk.co.jp Thu Feb 24 03:39:27 2000 From: jwt-python@dskk.co.jp (Jim Tittsler) Date: Thu, 24 Feb 2000 12:39:27 +0900 Subject: [Image-SIG] PIL JPEG In-Reply-To: ; from rm1@student.cs.ucc.ie on Wed, Feb 23, 2000 at 06:39:44PM +0000 References: Message-ID: <20000224123927.A20908@mail.dskk.co.jp> On Wed, Feb 23, 2000 at 06:39:44PM +0000, Robert Moloney wrote: > How can I save an image as progressive jpeg > > I get errors when I try > image1 = Image.save(image2,"JPEG",progression) I believe you need to make it a keyword option: Image.save("myimage2.jpg", "JPEG", progressive=1) Also note that there may be an inconsistency, in that JpegImagePlugin appears to check for the name 'progressive' rather than the documented 'progression'. (And when a progessive JPEG is read in, the info dictionary gets a 'progression' entry.) Jim P.S. The Image.save method is documented as always returning None, so your image1 may be boring. From reza@psych.utoronto.ca Sun Feb 27 22:53:56 2000 From: reza@psych.utoronto.ca (Reza Habib) Date: Sun, 27 Feb 2000 17:53:56 -0500 Subject: [Image-SIG] trouble using PIL on windows Message-ID: <000101bf8175$86ed0420$250f6395@newton> Hello. I'm new to python and pil. I've downloaded and installed pil and am now trying to use it in pythonwin. Just to test it, I typed the following code and got this stack trace: image = PIL.Image.fromstring('L',147030,data) Traceback (innermost last): File "", line 1, in ? File "d:\programs\libraries\python\py152\PIL\Image.py", line 853, in fromstring im = new(mode, size) File "d:\programs\libraries\python\py152\PIL\Image.py", line 840, in new return Image()._makeself(core.fill(mode, size, color)) File "d:\programs\libraries\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 How do I install the _imaging C module? I see a file called _imaging.dll, but for some reason it is not being loaded (no matter which directory I copy this file to). Any help would be appreciated. Thank you. Reza From fredrik@pythonware.com Mon Feb 28 09:44:00 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Mon, 28 Feb 2000 10:44:00 +0100 Subject: [Image-SIG] trouble using PIL on windows References: <000101bf8175$86ed0420$250f6395@newton> Message-ID: <004001bf81d0$57bf78d0$f29b12c2@secret.pythonware.com> > ImportError: The _imaging C module is not installed >=20 > How do I install the _imaging C module? I see a file called = _imaging.dll, > but for some reason it is not being loaded (no matter which directory = I copy > this file to). Any help would be appreciated. Thank you. the _imaging.dll file should be placed some- where along your Python search path. to figure out what goes wrong, fire up your python interpreter and type: >>> import _imaging if you get an ImportError, check that sys.path is what you expect: >>> import sys >>> sys.path [list of directories] From d.hoeppner@tu-bs.de Mon Feb 28 10:09:09 2000 From: d.hoeppner@tu-bs.de (Dierk Hoeppner) Date: Mon, 28 Feb 2000 11:09:09 +0100 Subject: [Image-SIG] PIL and TIFF Message-ID: Is it true that PIL connot deal with TIFF group4 odr group3 compression? I downloaded the precompiled binary distribution pil-win32- 991101.zip thanks in advance Dierk H=F6ppner Braunschweig University Library Pockelsstr. 13 D-38106 Braunschweig Germany Tel: +49-531-391-5066 Fax: -5836 E-Mail: d.hoeppner@tu-bs.de From fredrik@pythonware.com Tue Feb 29 11:51:57 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Tue, 29 Feb 2000 12:51:57 +0100 Subject: [Image-SIG] PIL and TIFF References: Message-ID: <008f01bf82ab$6207f390$f29b12c2@secret.pythonware.com> Dierk Hoeppner wrote: > Is it true that PIL connot deal with TIFF group4 odr group3=20 > compression? that's correct. there are no CCITT codecs in PIL 1.0. several people have written interfaces for Sam Leffler's libtiff (some have even promised me patches), but no such module has yet been published. From fredrik@pythonware.com Tue Feb 29 11:54:21 2000 From: fredrik@pythonware.com (Fredrik Lundh) Date: Tue, 29 Feb 2000 12:54:21 +0100 Subject: [Image-SIG] Documentation References: Message-ID: <00ce01bf82ab$c652b1f0$f29b12c2@secret.pythonware.com> Joshua Kifer wrote: > Is there documentation other than the Draft (1999-02-12) that details = all > or part of the PIL API? I'm afraid not. I hope to get around to fix this in time for the 1.0.1 release (the draft is mostly up to date; only a few methods are missing). From reza@psych.utoronto.ca Tue Feb 29 13:09:17 2000 From: reza@psych.utoronto.ca (Reza Habib) Date: Tue, 29 Feb 2000 08:09:17 -0500 Subject: [Image-SIG] trouble using PIL on windows In-Reply-To: <004001bf81d0$57bf78d0$f29b12c2@secret.pythonware.com> Message-ID: <000001bf82b6$2f03f330$9c776395@newton> Hi. Thanks for the advice. I put the _imaging.dll in the python root directory (i.e. d:\python). It still won't load. When I type: import _imaging I get the following error: Traceback (innermost last): File "", line 1, in ? ImportError: DLL load failed: The specified module could not be found. When I do sys.path however, it lists d:\python as being part of the python search path. Any other suggestions? Thanks again. Reza -----Original Message----- From: image-sig-admin@python.org [mailto:image-sig-admin@python.org]On Behalf Of Fredrik Lundh Sent: Monday, February 28, 2000 4:44 AM To: Reza Habib; image-sig@python.org Subject: Re: [Image-SIG] trouble using PIL on windows > ImportError: The _imaging C module is not installed > > How do I install the _imaging C module? I see a file called _imaging.dll, > but for some reason it is not being loaded (no matter which directory I copy > this file to). Any help would be appreciated. Thank you. the _imaging.dll file should be placed some- where along your Python search path. to figure out what goes wrong, fire up your python interpreter and type: >>> import _imaging if you get an ImportError, check that sys.path is what you expect: >>> import sys >>> sys.path [list of directories] _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From schorsch@schorsch.com Tue Feb 29 13:31:32 2000 From: schorsch@schorsch.com (Georg Mischler) Date: Tue, 29 Feb 2000 08:31:32 -0500 (EST) Subject: [Image-SIG] trouble using PIL on windows In-Reply-To: <000001bf82b6$2f03f330$9c776395@newton> Message-ID: Reza Habib wrote: > Hi. Thanks for the advice. I put the _imaging.dll in the python root > directory (i.e. d:\python). It still won't load. When I type: > > import _imaging > > I get the following error: > > Traceback (innermost last): > File "", line 1, in ? > ImportError: DLL load failed: The specified module could not be found. > > When I do sys.path however, it lists d:\python as being part of the python > search path. Any other suggestions? Thanks again. You could try renaming it to _imaging.pyd. I'm not quite sure if I fully understand when Python looks for *.dll and when for *.pyd files, but the latter is definitively a convention for C-extensions and works for me with _imaging. -schorsch -- Georg Mischler -- simulations developer -- schorsch at schorsch.com +schorsch.com+ -- lighting design tools -- http://www.schorsch.com/ From reza@psych.utoronto.ca Tue Feb 29 14:16:36 2000 From: reza@psych.utoronto.ca (Reza Habib) Date: Tue, 29 Feb 2000 09:16:36 -0500 Subject: [Image-SIG] trouble using PIL on windows In-Reply-To: Message-ID: <000001bf82bf$96c48850$09706395@newton> Hi. Still no luck. Neither changing the name to _imaging.pyd or moving the file to the root python directory allowed it to be loaded, always producing the same error (see below). This is quite strange since I have no trouble loading the other modules I have installed (pymat, numpy, wxpython, tkinter). Could there be files missing in the windows distribution of PIL - I downloaded this file: pil-win32-991101.zip. Any other suggestions? Thanks. Reza -----Original Message----- From: image-sig-admin@python.org [mailto:image-sig-admin@python.org]On Behalf Of Georg Mischler Sent: Tuesday, February 29, 2000 8:32 AM To: image-sig@python.org Subject: RE: [Image-SIG] trouble using PIL on windows Reza Habib wrote: > Hi. Thanks for the advice. I put the _imaging.dll in the python root > directory (i.e. d:\python). It still won't load. When I type: > > import _imaging > > I get the following error: > > Traceback (innermost last): > File "", line 1, in ? > ImportError: DLL load failed: The specified module could not be found. > > When I do sys.path however, it lists d:\python as being part of the python > search path. Any other suggestions? Thanks again. You could try renaming it to _imaging.pyd. I'm not quite sure if I fully understand when Python looks for *.dll and when for *.pyd files, but the latter is definitively a convention for C-extensions and works for me with _imaging. -schorsch -- Georg Mischler -- simulations developer -- schorsch at schorsch.com +schorsch.com+ -- lighting design tools -- http://www.schorsch.com/ _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From schorsch@schorsch.com Tue Feb 29 16:02:52 2000 From: schorsch@schorsch.com (Georg Mischler) Date: Tue, 29 Feb 2000 11:02:52 -0500 (EST) Subject: [Image-SIG] trouble using PIL on windows In-Reply-To: <000001bf82bf$96c48850$09706395@newton> Message-ID: Reza Habib wrote: > Hi. Still no luck. Neither changing the name to _imaging.pyd or moving the > file to the root python directory allowed it to be loaded, always producing > the same error (see below). This is quite strange since I have no trouble > loading the other modules I have installed (pymat, numpy, wxpython, > tkinter). Could there be files missing in the windows distribution of PIL - > I downloaded this file: pil-win32-991101.zip. Any other suggestions? Did you compile Python yourself, and are running a debug build? If so, then all your external modules need to be debug builds as well (or at least the file name should follow the xxx_d.pyd pattern). It took me about two days to figure out that this was the reason I couldn't load _tkinter.pyd myself. As far as I can tell, this behaviour is completely undocumented, but of course I may have overlooked something. If this doesn't help you, then I'll have to pass the topic over to the experts... -schorsch -- Georg Mischler -- simulations developer -- schorsch at schorsch.com +schorsch.com+ -- lighting design tools -- http://www.schorsch.com/ From reza@psych.utoronto.ca Tue Feb 29 16:16:53 2000 From: reza@psych.utoronto.ca (Reza Habib) Date: Tue, 29 Feb 2000 11:16:53 -0500 Subject: [Image-SIG] trouble using PIL on windows In-Reply-To: Message-ID: <000401bf82d0$64059880$ab706395@newton> Hi. No, I didn't compile python. I downloaded the pre-built python 1.5.2 for windows. Thanks for your help. Reza -----Original Message----- From: image-sig-admin@python.org [mailto:image-sig-admin@python.org]On Behalf Of Georg Mischler Sent: Tuesday, February 29, 2000 11:03 AM To: image-sig@python.org Subject: RE: [Image-SIG] trouble using PIL on windows Reza Habib wrote: > Hi. Still no luck. Neither changing the name to _imaging.pyd or moving the > file to the root python directory allowed it to be loaded, always producing > the same error (see below). This is quite strange since I have no trouble > loading the other modules I have installed (pymat, numpy, wxpython, > tkinter). Could there be files missing in the windows distribution of PIL - > I downloaded this file: pil-win32-991101.zip. Any other suggestions? Did you compile Python yourself, and are running a debug build? If so, then all your external modules need to be debug builds as well (or at least the file name should follow the xxx_d.pyd pattern). It took me about two days to figure out that this was the reason I couldn't load _tkinter.pyd myself. As far as I can tell, this behaviour is completely undocumented, but of course I may have overlooked something. If this doesn't help you, then I'll have to pass the topic over to the experts... -schorsch -- Georg Mischler -- simulations developer -- schorsch at schorsch.com +schorsch.com+ -- lighting design tools -- http://www.schorsch.com/ _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From kuncej@mail.conservation.state.mo.us Tue Feb 29 17:23:16 2000 From: kuncej@mail.conservation.state.mo.us (Jeffrey Kunce) Date: Tue, 29 Feb 2000 11:23:16 -0600 Subject: [Image-SIG] trouble using PIL on windows Message-ID: >Hi. Thanks for the advice. I put the _imaging.dll in the python root >directory (i.e. d:\python). It still won't load. When I type: I had these same problems (just on Win98 - NT works fine out of the box) I tried so many things, that I can't remember what finally fixed it :-( Try this: 1) unzip the PIL distribution (I have pil-win32-991101.zip) into a scratch directory. You will get a folder "py152" containing: PIL (folder) Scripts (folder) _imaging.dll _tkinter.pyd PIL.pth 2) move the Scripts folder, _imaging.dll, and _tkinter.pyd into the PIL = folder 3) move the PIL folder and PIL.pth to your python root directory (c:\program files\python\ or wherever). 4) search out any other files named _imaging.dll, _imaging.pyd,=20 _tkinter.dll, or _tkinter.pyd that might possibly be on your python = path or on your system path. Move them somewhere python can't find them. (I got so frustrated, I moved them to a floppy). 5) see if PIL will run Good luck! --Jeff From KCAZA@cymbolic.com Tue Feb 29 17:41:21 2000 From: KCAZA@cymbolic.com (Kevin Cazabon) Date: Tue, 29 Feb 2000 09:41:21 -0800 Subject: [Image-SIG] trouble using PIL on windows Message-ID: I think the root of the problem is probably (as you elude to below) that Python accepts a file named EITHER ".pyd" or ".dll" as the same, but "prefers" the "pyd" file. So, if you have an older version of a file as a .pyd, and you install a new .dll, it still uses the older file. Basically, I'd like to see Python distributions like PIL standardize on ".pyd" files to eliminate this problem, but I do see the advantage of allowing Python itself to access both. Kevin Cazabon. >>> "Jeffrey Kunce" 02/29/00 09:23AM >>> >Hi. Thanks for the advice. I put the _imaging.dll in the python root >directory (i.e. d:\python). It still won't load. When I type: I had these same problems (just on Win98 - NT works fine out of the box) I tried so many things, that I can't remember what finally fixed it :-( Try this: 1) unzip the PIL distribution (I have pil-win32-991101.zip) into a scratch directory. You will get a folder "py152" containing: PIL (folder) Scripts (folder) _imaging.dll _tkinter.pyd PIL.pth 2) move the Scripts folder, _imaging.dll, and _tkinter.pyd into the PIL folder 3) move the PIL folder and PIL.pth to your python root directory (c:\program files\python\ or wherever). 4) search out any other files named _imaging.dll, _imaging.pyd, _tkinter.dll, or _tkinter.pyd that might possibly be on your python path or on your system path. Move them somewhere python can't find them. (I got so frustrated, I moved them to a floppy). 5) see if PIL will run Good luck! --Jeff _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From reza@psych.utoronto.ca Tue Feb 29 17:47:49 2000 From: reza@psych.utoronto.ca (Reza Habib) Date: Tue, 29 Feb 2000 12:47:49 -0500 Subject: [Image-SIG] trouble using PIL on windows In-Reply-To: Message-ID: <000001bf82dd$187d6e80$b5776395@newton> Hi Jeff. Thanks for the advice. I am running nt, and no luck. I also tried your suggestions, and that doesn't seem to work either. Does anyone seem to know why there are these problems with the PIL module. None of the other modules I've used have been this difficult to setup? Thanks to everyone on this list for your help (keep the suggestions coming). Reza -----Original Message----- From: Jeffrey Kunce [mailto:kuncej@mail.conservation.state.mo.us] Sent: Tuesday, February 29, 2000 12:23 PM To: reza@psych.utoronto.ca; image-sig@python.org Subject: RE: [Image-SIG] trouble using PIL on windows >Hi. Thanks for the advice. I put the _imaging.dll in the python root >directory (i.e. d:\python). It still won't load. When I type: I had these same problems (just on Win98 - NT works fine out of the box) I tried so many things, that I can't remember what finally fixed it :-( Try this: 1) unzip the PIL distribution (I have pil-win32-991101.zip) into a scratch directory. You will get a folder "py152" containing: PIL (folder) Scripts (folder) _imaging.dll _tkinter.pyd PIL.pth 2) move the Scripts folder, _imaging.dll, and _tkinter.pyd into the PIL folder 3) move the PIL folder and PIL.pth to your python root directory (c:\program files\python\ or wherever). 4) search out any other files named _imaging.dll, _imaging.pyd, _tkinter.dll, or _tkinter.pyd that might possibly be on your python path or on your system path. Move them somewhere python can't find them. (I got so frustrated, I moved them to a floppy). 5) see if PIL will run Good luck! --Jeff From kuncej@mail.conservation.state.mo.us Tue Feb 29 18:41:09 2000 From: kuncej@mail.conservation.state.mo.us (Jeffrey Kunce) Date: Tue, 29 Feb 2000 12:41:09 -0600 Subject: [Image-SIG] trouble using PIL on windows Message-ID: >Hi Jeff. Thanks for the advice. I am running nt, and no luck. I also >tried your suggestions, and that doesn't seem to work either. below is another idea, that was posted recently to comp.lang.python >Does anyone seem to know why there are these problems with the PIL = module. >None of the other modules I've used have been this difficult to setup? Good question. It only seems to happen to some installations, so I'm guessing that the PIL gurus either can't reproduce the problem, or believe its only because of newbie ignorance. --Jeff ******** from comp.lang.python ******** =20 >Try putting this line at the top of Image.py (into the PIL directory): > >import FixTk > >The problem here is that _imaging.dll can't find your tcl/tk installation,= >but >with the line above python must find it for you. > >Prior to Python 1.5.2 you needed to set some environtment variables >to find tcl/tk and _imaging is still working in that way. > >A question for the SecretLab People: Why _imaging.dll is linked >to the tcl/tk DLLs ? That means that PIL did t work without tcl/tk? > >Cristian Echeverria > >