From fredrik@pythonware.com Thu May 3 13:18:42 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Thu, 3 May 2001 14:18:42 +0200 Subject: [Image-SIG] PIL 1.1.2 release candidate 1 now available Message-ID: <009a01c0d3cb$326fe670$0900a8c0@spiff> I just posted a prerelease of the 1.1.2 maintenance release to http://www.pythonware.com/downloads/Imaging-1.1.2c1.tar.gz the main reason for this update is a couple of 2.1 issues, but several bug fixes also made it (some interesting contributions didn't make it, though -- we'll deal with them in 1.1.3). if you miss something really essential, let me know asap. we plan to release 1.1.2 final on monday (may 7). Cheers /F *** Changes from release 1.1.1 to 1.1.2 *** + Adapted to Python 2.1. Among other things, all uses of the "regex" module has been repleased with "re". + Fixed attribute error when reading large PNG files (this bug was introduced in maintenance code released after the 1.1.1 release) + Ignore non-string objects in sys.path + Fixed Image.transform(EXTENT) for negative xoffsets + Fixed bitmap/text drawing in fill mode. + Fixed "getextrema" to work also for multiband images. + Added transparency support for L and P images to the PNG codec. + Improved support for read-only images. The "load" method now sets the "readonly" attribute for memory-mapped images. Operations that modifies an image in place (such as "paste" and drawing operations) creates an in-memory copy of the image, if necessary. (before this change, any attempt to modify a memory-mapped image resulted in a core dump...) + Added special cases for lists everywhere PIL expects a sequence. This should speed up things like "putdata" and drawing operations. + The Image.offset method is deprecated. Use the ImageChops.offset function instead. + Changed ImageChops operators to copy palette and info dictionary from the first image argument. From odeckmyn.list@teaser.fr Thu May 3 14:04:40 2001 From: odeckmyn.list@teaser.fr (Olivier Deckmyn) Date: Thu, 3 May 2001 15:04:40 +0200 Subject: [Image-SIG] PIL 1.1.2 release candidate 1 now available References: <009a01c0d3cb$326fe670$0900a8c0@spiff> Message-ID: <001b01c0d3d1$9d9d6f20$0d00000a@ODECKMYN2K> PIL goes on being impressive ! Congratulations !!! ----- Original Message ----- From: "Fredrik Lundh" To: Sent: Thursday, May 03, 2001 2:18 PM Subject: [Image-SIG] PIL 1.1.2 release candidate 1 now available > I just posted a prerelease of the 1.1.2 maintenance release to > > http://www.pythonware.com/downloads/Imaging-1.1.2c1.tar.gz > > the main reason for this update is a couple of 2.1 issues, but > several bug fixes also made it (some interesting contributions > didn't make it, though -- we'll deal with them in 1.1.3). if you > miss something really essential, let me know asap. > > we plan to release 1.1.2 final on monday (may 7). > > Cheers /F > > > *** Changes from release 1.1.1 to 1.1.2 *** > > + Adapted to Python 2.1. Among other things, all uses of the > "regex" module has been repleased with "re". > > + Fixed attribute error when reading large PNG files (this bug > was introduced in maintenance code released after the 1.1.1 > release) > > + Ignore non-string objects in sys.path > > + Fixed Image.transform(EXTENT) for negative xoffsets > > + Fixed bitmap/text drawing in fill mode. > > + Fixed "getextrema" to work also for multiband images. > > + Added transparency support for L and P images to the PNG codec. > > + Improved support for read-only images. The "load" method now > sets the "readonly" attribute for memory-mapped images. Operations > that modifies an image in place (such as "paste" and drawing operations) > creates an in-memory copy of the image, if necessary. (before this > change, any attempt to modify a memory-mapped image resulted in a > core dump...) > > + Added special cases for lists everywhere PIL expects a sequence. > This should speed up things like "putdata" and drawing operations. > > + The Image.offset method is deprecated. Use the ImageChops.offset > function instead. > > + Changed ImageChops operators to copy palette and info dictionary > from the first image argument. > > > > > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://mail.python.org/mailman/listinfo/image-sig From bh@intevation.de Thu May 3 15:02:22 2001 From: bh@intevation.de (Bernhard Herzog) Date: 03 May 2001 16:02:22 +0200 Subject: [Image-SIG] PIL 1.1.2 release candidate 1 now available In-Reply-To: <009a01c0d3cb$326fe670$0900a8c0@spiff> References: <009a01c0d3cb$326fe670$0900a8c0@spiff> Message-ID: <6q4rv2ttsh.fsf@abnoba.intevation.de> "Fredrik Lundh" writes: > I just posted a prerelease of the 1.1.2 maintenance release to > > http://www.pythonware.com/downloads/Imaging-1.1.2c1.tar.gz Works fine in Sketch and MapIt!. Two other things that should perhaps be mentioned in the changes list: + Installing PIL as a 'pure package' i.e. without the PIL directory itself being in sys.path) finally works + The Png plugin has been added to the list of preloaded standard formats -- Intevation GmbH http://intevation.de/ Sketch http://sketch.sourceforge.net/ MapIt! http://mapit.de/ From fredrik@effbot.org Thu May 3 20:47:54 2001 From: fredrik@effbot.org (Fredrik Lundh) Date: Thu, 3 May 2001 21:47:54 +0200 Subject: [Image-SIG] Re: I have problem about PIL Message-ID: <051b01c0d409$f4629730$e46940d5@hagrid> (nattiya, the mailing list software doesn't allow attachments over 40k or so, so your mail didn't get through to the list. however, I managed to get my hands on it anyway...) Nattiya wrote: > I have used PIL, and I have problem with draw.text() module > /.../ See the text that is in left. I want it to rotate 90 degree > to stay along with Y-axis. I've attached a simple font wrapper that lets you write "transposed" text via the standard draw.text() function. to use this, create a font in the usual way, and then wrap it font = ImageFont.load(...) vertical_font = TransposedFont(font, Image.ROTATE_90) draw.text((x, y), text, vertical_font) the second argument can be any valid argument to the Image object's transpose method (i.e. ROTATE_90, ROTATE_180, ROTATE_270, FLIP_LEFT_RIGHT, or FLIP_TOP_BOTTOM), or None to use the font as is. hope this helps! Cheers /F # TransposedFont.py import Image class TransposedFont: def __init__(self, font, orientation=None): self.font = font self.orientation = orientation def getsize(self, text): w, h = self.font.getsize(text) if self.orientation in (Image.ROTATE_90, Image.ROTATE_270): return h, w return w, h def getmask(self, text): im = self.font.getmask(text) if self.orientation is not None: return im.transpose(self.orientation) return im # end From erik@neo.at Fri May 4 07:03:01 2001 From: erik@neo.at (Erik Pojar) Date: Fri, 4 May 2001 08:03:01 +0200 Subject: [Image-SIG] paletted images and PIL 1.1.1 Message-ID: <001201c0d45f$e09a3cc0$3200a8c0@erik> Hi, I have a few questions regarding paletted images in PIL 1.1.1. 1) When I read an RGBA image (from e.g. a TIFF file) and then convert it to 8 bit indexed (adaptive), is the alpha information still there? In other words: is the palette a table of 256 R,G,B values or a table of 256 R,G,B,A values? (The documentation is a bit unclear in this point. However, it suggests, that the alpha information _might_ still be available: in the P mode there are "8-bit pixels, mapped to any other mode using a colour palette" If the palette does not hold alpha information: Is that planned for future releases? Is this feature available in the "commercial support" version (1.2)? 2) How can I read the contents of the palette. The palette pointer is always (none). I have read some articles on how to set a palette with PIL, but not how to read the palette. Thanks in advance, Erik ----------------------------- .......coming from Erik Pojar neo Software Produktions GmbH Email: erik@neo.at Look at: http://www.neo.at From fredrik@pythonware.com Fri May 4 14:06:45 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Fri, 4 May 2001 15:06:45 +0200 Subject: [Image-SIG] PIL 1.1.2 release candidate 1 now available References: <009a01c0d3cb$326fe670$0900a8c0@spiff> Message-ID: <002b01c0d49b$12ce1910$0900a8c0@spiff> I wrote: > > I just posted a prerelease of the 1.1.2 maintenance release to > > http://www.pythonware.com/downloads/Imaging-1.1.2c1.tar.gz updated docs are now available from: http://www.pythonware.com/library/the-python-imaging-library.htm the HTML version has some minor rendering glitches; if you want hardcopy, use the PDF version. PIL 1.1.2 final will be released on monday. Cheers /F From fredrik@pythonware.com Tue May 8 19:18:48 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Tue, 8 May 2001 20:18:48 +0200 Subject: [Image-SIG] PIL 1.1.2 release candidate 1 now available References: <009a01c0d3cb$326fe670$0900a8c0@spiff> <6q4rv2ttsh.fsf@abnoba.intevation.de> Message-ID: <004801c0d7eb$54be7bf0$e46940d5@hagrid> just a quick heads-up: > I just posted a prerelease of the 1.1.2 maintenance release to > > http://www.pythonware.com/downloads/Imaging-1.1.2c1.tar.gz the test results have all been positive, and we've decided to ship the release candidate as the final version (well, there will be some minor changes to the readme and changes files, but that's all). the release was supposed to go out yesterday, but I've been home sick for a couple of days, and it looks like I'll have to stay home for another day or two. the final source kit will go out as soon as I'm back at the office. Cheers /F From H.dewendt@systec.de Wed May 9 08:33:24 2001 From: H.dewendt@systec.de (Heiner de Wendt) Date: Wed, 9 May 2001 09:33:24 +0200 Subject: [Image-SIG] Images in Zope/ReportLab Message-ID: Hi all, I'm trying since days to get this working, and start becoming somewhat desperate. I want to use Zope and ReportLab to create PDFs from within Zope. It works in general, but I don't manage to include images in the PDFs. When I do it locally (i.e. without Zope), it works fine, but I just don't manage to access the images in the ZODB in the right way. Here's an example code: * def page1(self,c,my1,my2): c.setFont("Times-Roman",8) c.setFillColorRGB(0.1,0.1,0.1) c.drawString(60,775,my1) c.drawString(60,750,my2) c.drawInlineImage(my2,60,500,width=100,height=80) def get(self): import PIL.Image from reportlab.pdfgen import canvas c = canvas.Canvas("/opt/zope/2-3-0/pdffiles/pdf1.pdf") my1=str(self.image1.id) my2=str(self.image1) page1(self,c,my1,my2) c.showPage() c.save() * I've tried various things in the "drawInlineImage" line, even directly giving the image name ('image1'), but ReportLab doesn't find it. The strings my1 and my2 give the following results: my1 (which is self.image1.id) : my2 (which is self.image1): .. So, when creating the strings, the image *is* found. I just don't know how to correctly access it in the drawInlineImage line. Can someone PLEASE help me? I'm really somewhat desperate by now... Big thanks in advance, Heiner From odeckmyn.list@teaser.fr Wed May 9 08:55:45 2001 From: odeckmyn.list@teaser.fr (Olivier Deckmyn) Date: Wed, 9 May 2001 09:55:45 +0200 Subject: [Image-SIG] Images in Zope/ReportLab References: Message-ID: <008501c0d85d$73d9ddf0$0d00000a@ODECKMYN2K> Must be name clash between PIL.Image and "Zope".Image ... ----- Original Message ----- From: "Heiner de Wendt" To: Sent: Wednesday, May 09, 2001 9:33 AM Subject: [Image-SIG] Images in Zope/ReportLab > Hi all, > > I'm trying since days to get this working, and start becoming > somewhat desperate. > > I want to use Zope and ReportLab to create PDFs from within Zope. It > works in general, but I don't manage to include images in the PDFs. > When I do it locally (i.e. without Zope), it works fine, but I just > don't manage to access the images in the ZODB in the right way. > > Here's an example code: > > * > def page1(self,c,my1,my2): > c.setFont("Times-Roman",8) > c.setFillColorRGB(0.1,0.1,0.1) > c.drawString(60,775,my1) > c.drawString(60,750,my2) > c.drawInlineImage(my2,60,500,width=100,height=80) > > def get(self): > import PIL.Image > from reportlab.pdfgen import canvas > c = canvas.Canvas("/opt/zope/2-3-0/pdffiles/pdf1.pdf") > my1=str(self.image1.id) > my2=str(self.image1) > page1(self,c,my1,my2) > c.showPage() > c.save() > * > > I've tried various things in the "drawInlineImage" line, even > directly giving the image name ('image1'), but ReportLab doesn't find > it. > > The strings my1 and my2 give the following results: > my1 (which is self.image1.id) : > my2 (which is self.image1): alt=".." height="80" width="100" border="0"/> > > So, when creating the strings, the image *is* found. I just don't > know how to correctly access it in the drawInlineImage line. > > Can someone PLEASE help me? I'm really somewhat desperate by now... > > Big thanks in advance, > > Heiner > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://mail.python.org/mailman/listinfo/image-sig From fredrik@pythonware.com Wed May 9 09:34:42 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 9 May 2001 10:34:42 +0200 Subject: [Image-SIG] Images in Zope/ReportLab References: Message-ID: <008d01c0d862$e6871160$e46940d5@hagrid> Heiner de Wendt wrote:> Here's an example code: > > * > def page1(self,c,my1,my2): > c.setFont("Times-Roman",8) > c.setFillColorRGB(0.1,0.1,0.1) > c.drawString(60,775,my1) > c.drawString(60,750,my2) > c.drawInlineImage(my2,60,500,width=100,height=80) > > def get(self): > import PIL.Image > from reportlab.pdfgen import canvas > c = canvas.Canvas("/opt/zope/2-3-0/pdffiles/pdf1.pdf") > my1=str(self.image1.id) > my2=str(self.image1) > page1(self,c,my1,my2) > c.showPage() > c.save() > * > > I've tried various things in the "drawInlineImage" line, even > directly giving the image name ('image1'), but ReportLab doesn't find > it. > > The strings my1 and my2 give the following results: > my1 (which is self.image1.id) : > my2 (which is self.image1): alt=".." height="80" width="100" border="0"/> looks like you're a bit too optimistic: ReportLab's drawInlineImage method expects a *filename* or a PIL Image object, not a string containing ""... try passing in the filename you used to create self.image1. (or use PIL.Image.open(filename) to create a PIL object, and pass that one to drawInlineImage) Cheers /F From H.dewendt@systec.de Wed May 9 10:24:21 2001 From: H.dewendt@systec.de (Heiner de Wendt) Date: Wed, 9 May 2001 11:24:21 +0200 Subject: [Image-SIG] Images in Zope/ReportLab In-Reply-To: <008d01c0d862$e6871160$e46940d5@hagrid> Message-ID: Hi, > looks like you're a bit too optimistic: ReportLab's drawInlineImage > method expects a *filename* or a PIL Image object, not a string > containing ""... I already thought so ;) I got to this code after various suggestions by other people, seems some of those suggestions weren't *that* good. But, when I do something like that: c.drawInlineImage(self.image1,50,500,width=100,height=180) I get an "Attribute Error: Convert". When I try putting it in quotation marks ('self.image1' or just 'image1') he says something like "File or Directory not found"; when I just use (image1,50...), I get a Name Error (I guess it's quite the same as the 'not found' one..). > (or use PIL.Image.open(filename) to create a PIL object, and pass > that one to drawInlineImage) How do I do that? I tried this: obj=PIL.Image.open(self.image1) and got the error message Error Type: AttributeError Error Value: read Thanks for any further help, Heiner From fredrik@pythonware.com Wed May 9 10:41:46 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 9 May 2001 11:41:46 +0200 Subject: [Image-SIG] Images in Zope/ReportLab References: Message-ID: <025701c0d86c$44c25d30$e46940d5@hagrid> Heiner de Wendt wrote: > But, when I do something like that: > > c.drawInlineImage(self.image1,50,500,width=100,height=180) > > I get an "Attribute Error: Convert". you can spend all day passing self.image1 to different functions; it still won't turn itself into a filename. what did you do to create the self.image1 object? Cheers /F From H.dewendt@systec.de Wed May 9 10:49:04 2001 From: H.dewendt@systec.de (Heiner de Wendt) Date: Wed, 9 May 2001 11:49:04 +0200 Subject: [Image-SIG] Images in Zope/ReportLab In-Reply-To: <025701c0d86c$44c25d30$e46940d5@hagrid> Message-ID: Hi, > you can spend all day passing self.image1 to different > functions; it still won't turn itself into a filename. But how DO I turn it into a filename? > what did you do to create the self.image1 object? I uploaded the image in Zope, and that's it. Thanks and bye, Heiner From clee@v1.wustl.edu Wed May 9 12:55:50 2001 From: clee@v1.wustl.edu (Christopher Lee) Date: Wed, 9 May 2001 06:55:50 -0500 (CDT) Subject: [Image-SIG] Images in Zope/ReportLab In-Reply-To: References: <025701c0d86c$44c25d30$e46940d5@hagrid> Message-ID: <15097.12358.222895.845132@gnwy100.wuh.wustl.edu> >>>>> "Heiner" == Heiner de Wendt writes: Heiner> Hi, >> you can spend all day passing self.image1 to different functions; it >> still won't turn itself into a filename. Heiner> But how DO I turn it into a filename? Here's a message exchange between Tim Cook and Ed Colmar that may help: (Ultimately, you may want to look at Zope's source code.) ----------------------------------------------------------------------- Hi Tim Grab my GreetingCard product off zope.org: www.zope.org/Members/8days/GreetingCard/ To answer your question here is a code snippet: ## This file is uploaded by the user into a localFS folder uploadedfile = str(self.uploadedimage.file_name()) c.drawInlineImage(uploadedfile,1.25*inch,1.25*inch,width=5.75*inch,height=4* inch) ## This image is a hardcoded logo os.chdir('/usr/local/zope/greetingcardLogos/') c.drawInlineImage('upsideownlogo.jpg', 3.5*inch, 9.5*inch,width=1.71*inch, height=.72*inch) Hope this helps! -e- ----- Original Message ----- From: "Tim Cook" To: "ed colmar" Sent: Friday, April 27, 2001 9:30 AM Subject: Re: [reportlab-users] Images and zope > ed colmar wrote: > > > > hey all! > > > > I worked around this same problem by using the LocalFS product to store > > the images in the filesystem... Reportlab easily pulls them in in this > > case. > > > > Hi Ed, > > Mind sharing some sample code? > > Let's say you have a LocalFS object with an id of 'image_dir' how > do you insert 'image01.jpg' in the PDF? > > Thanks, > -- > Tim Cook, President - FreePM,Inc. > http://www.FreePM.com Office: (731) 884-4126 > ONLINE DEMO: http://www.freepm.org:8080/FreePM > From jasonic@nomadicsltd.com Wed May 9 18:44:28 2001 From: jasonic@nomadicsltd.com (Jason Cunliffe) Date: Wed, 9 May 2001 13:44:28 -0400 Subject: [Image-SIG] Re: [Zope] Homepage References: <3AF975F6.E8C99881@nipltd.com> Message-ID: <010101c0d8af$b2b8b620$c3090740@megapathdsl.net> From: "Chris Withers" others will be zoped in months time. > > *grinz* If only you could get www.fhm.com to be Zope hosted, that way I could > browse the, urm, pictures, and have the exucse that I'm 'testing out Zope' :-) yes lovely girls. I had never looked at FHM site. I think the 'Zoomify' technology they use is great. [as seen with Win98se IE5.5] http://www.zoomify.com/zoomster/search/zoomsterSearch.asp Preparing a Zopesite for artists to upload ditigal artwork. Meeting nect week wiht some printers who have large format + fine-art qualtity inkjets to offer a range of netart-on-demand custom print services. It's a good Zope/ZEO application. At them moment working with LocalFS, ExtFile/Image & Photo product so see hwo we can offer efficent visual broswing of work. Having PIL behind Zope is very cool. Zoomify is very impressive though. They have a nice drag'n'drop interface too http://www.zoomify.com/zoomster/account/zoomsterCreate.asp Does anyone have any ideas how to do this best with Zope and/or some other openSource cross platform garphics toolkits? How could one do a Zoomify with PIL ? thanks ./Jason ___________________________________________________________ Jason CUNLIFFE = NOMADICS['Interactive Art and Technology'] From kipfer@logiball.de Thu May 10 14:20:24 2001 From: kipfer@logiball.de (Anja Kipfer) Date: Thu, 10 May 2001 15:20:24 +0200 Subject: [Image-SIG] NT, IIS and png Message-ID: <01C0D964.BCC18510.kipfer@logiball.de> Hiya, there's a problem with displaying png-data when the script runs in IIS 4.0 on NT. Using Apache on NT the same code /png-files just work fine! The error occurs a follows: Image.save is called: apply(image.save, (sys.stdout, format), params) this calls PngImagePlugin._save(im, fp, filename, chunk=putchunk, check=0) this calls ImageFile._save(...) Here, the script crashes at line fh=fp.fileno(), whereby fp is the passed-through parameter sys.stdout If I call image.save with a filename instead, a correct png-file gets created - but I have it in the file system and not on the screen where I want it to be! Do I need a certain environment-variable or similar to be able to write in sys.stdout? Does anyone have an idea of how to solve that problem??? With many thanks in advance, Anja From aclover@1value.com Thu May 10 17:37:03 2001 From: aclover@1value.com (Clover Andrew) Date: Thu, 10 May 2001 18:37:03 +0200 Subject: [Image-SIG] NT, IIS and png Message-ID: Anja Kipfer wrote: > Do I need a certain environment-variable or similar to be=20 > able to write in sys.stdout? No, the problem is most likely that you're not writing to stdout as a binary file. LFs are probably being changed into CRLFs, making the file invalid. Check your IIS Python-script-handler in 'Home directory-> Configuration' - if I remember correctly, you need the '-u' switch to get a binary stdout, so the command should probably be something like X:\Program Files\Python\python.exe -u "%s" "%s" Does that fix it? --=20 Andrew Clover Technical Consultant 1VALUE.com AG From chubbs@gmu.edu Thu May 10 18:46:43 2001 From: chubbs@gmu.edu (Cathy Hubbs) Date: Thu, 10 May 2001 13:46:43 -0400 Subject: [Image-SIG] Help with jpeg-6b Message-ID: <3AFAD403.EFD9C133@gmu.edu> This is a multi-part message in MIME format. --------------23260C5FC9CE708706BA58DF Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I have an Octane running Irix 6.5.10 Python 1.5.2 zlib 1.1.3 libtool 1.3.5 When I run configure I get a message that says the jconfig.h file in "unchanged." If I continue % make install I get the following error: "You must prepare a system-dependent jconfig.h file." I'm too novice to figure out what needs to be changed int he jconfig.h file (it's short and sweet). Can you provide me with a copy for IRIX boxes? Thanks --------------23260C5FC9CE708706BA58DF Content-Type: text/x-vcard; charset=us-ascii; name="chubbs.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Cathy Hubbs Content-Disposition: attachment; filename="chubbs.vcf" begin:vcard n:Hubbs;Cathy tel;fax:703-993-8401 tel;work:703-993-8384 x-mozilla-html:FALSE org:George Mason University;School of Computational Sciences at Prince William adr:;;10900 University Blvd;Manassas;VA;20110; version:2.1 email;internet:chubbs@gmu.edu note;quoted-printable:'It must be remembered that the purpose of education is not to fill the=0D=0Aminds of students with facts... it is to teach them to think, and always to=0D=0Athink for themselves.' ~ Robert Hutchins=0D=0A=0D=0A x-mozilla-cpt:;21408 fn:Cathy Hubbs end:vcard --------------23260C5FC9CE708706BA58DF-- From fredrik@pythonware.com Thu May 10 22:14:14 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Thu, 10 May 2001 23:14:14 +0200 Subject: [Image-SIG] NT, IIS and png References: <01C0D964.BCC18510.kipfer@logiball.de> Message-ID: <00a501c0d996$2b9bda90$e46940d5@hagrid> Anja Kipfer wrote: > The error occurs a follows: > > Image.save is called: apply(image.save, (sys.stdout, format), params) > this calls PngImagePlugin._save(im, fp, filename, chunk=putchunk, check=0) > this calls ImageFile._save(...) > Here, the script crashes at line fh=fp.fileno(), whereby fp is the > passed-through parameter sys.stdout - do you have more info about the crash? (do you get an exception? what does it say?) - also, is sys.stdout an ordinary Python file object or something else when you run under IIS? if it's an ordinary file object, "print sys.stdout" should give something like: ', mode 'w' at 00867520> - if it's a non-standard object with a bad/broken file handle connected to it, the following wrapper might help: class NoRealFile: def __init__(self, file): self.file = file def __getattr__(self, name): if name == "fileno": raise AttributeError return getattr(self.file, name) image.save(NoRealFile(sys.stdout), "PNG") - if nothing else helps, save via a StringIO object: buf = StringIO.StringIO() image.save(buf, "PNG") sys.stdout.write(buf.getvalue()) Cheers /F From info@pythonware.com Fri May 11 14:12:32 2001 From: info@pythonware.com (PythonWare) Date: Fri, 11 May 2001 15:12:32 +0200 Subject: [Image-SIG] ANNOUNCEMENT: The Python Imaging Library, version 1.1.2 Message-ID: <004b01c0da1c$0bd790b0$0900a8c0@spiff> yet another release from the labs: The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities. Version 1.1.2 is a maintenance release, which fixes a couple of problems caused by incompatible changes in Python 2.1. It also fixes some other bugs. See below for details. Get your copy of the source kit here: http://www.pythonware.com/downloads/#pil For more information, including support options and information on the PIL plus extensions, see the product site: http://www.pythonware.com/products/pil/ Updated documentation is available from the PythonWare library: http://www.pythonware.com/library/ enjoy, the pil team "Secret Labs -- makers of fine pythonware since 1997." --- Changes from release 1.1.1 to 1.1.2: + Adapted to Python 2.1. Among other things, all uses of the "regex" module has been repleased with "re". + Fixed attribute error when reading large PNG files (this bug was introduced in maintenance code released after the 1.1.1 release) + Ignore non-string objects in sys.path + Fixed Image.transform(EXTENT) for negative xoffsets + Fixed loading of image plugins if PIL is installed as a package. (The plugin loader now always looks in the directory where the Image.py module itself is found, even if that directory isn't on the standard search path) + The Png plugin has been added to the list of preloaded standard formats + Fixed bitmap/text drawing in fill mode. + Fixed "getextrema" to work also for multiband images. + Added transparency support for L and P images to the PNG codec. + Improved support for read-only images. The "load" method now sets the "readonly" attribute for memory-mapped images. Operations that modifies an image in place (such as "paste" and drawing operations) creates an in-memory copy of the image, if necessary. (before this change, any attempt to modify a memory-mapped image resulted in a core dump...) + Added special cases for lists everywhere PIL expects a sequence. This should speed up things like "putdata" and drawing operations. + The Image.offset method is deprecated. Use the ImageChops.offset function instead. + Changed ImageChops operators to copy palette and info dictionary from the first image argument. --- From kees@visualspace.nl Fri May 11 17:00:16 2001 From: kees@visualspace.nl (Kees van Drongelen / VisualSpace) Date: Fri, 11 May 2001 18:00:16 +0200 Subject: [Image-SIG] antialiasing in pil Message-ID: Hi there, I'am new to pil and trying to create images dynamically in zope: I believe pil supports antialiasing. The thing is I can draw things but not smooth enough: please! does anybody knows what i'am doing wrong? ################################################## # draw a smooth circle ################################################## import Image, ImageDraw dxy=100,100 bgcolor=255,0,0 pencolor=255,255,255 fillcolor=0,0,255 im = Image.new("RGBA",(dxy),(bgcolor)) ########### draw something draw = ImageDraw.Draw(im) draw.ellipse((10,10, 90,90), outline=pencolor, fill=fillcolor) del draw im.save('output.png') -- |||||||||||||||||||||||||||||||||||| VisualSpace grafische en interactieve vormgeving Krelagestraat 34 2012 CT Haarlem T 023 532 33 66 F 023 532 33 04 http://www.visualspace.nl |||||||||||||||||||||||||||||||||||| From Kevin.Cazabon@gretag.com Fri May 11 18:04:33 2001 From: Kevin.Cazabon@gretag.com (Kevin.Cazabon@gretag.com) Date: Fri, 11 May 2001 11:04:33 -0600 Subject: [Image-SIG] antialiasing in pil Message-ID: "Anti-Aliasing" by definition is performed by rendering at a higher resolution and downsampling using interpolation. I'm not sure if PIL can automatically do this for you, but it's not hard to do yourself: -render at 2x, 3x, 4x, or higher resolution than you need -downsample the image using "bicubic" to the real size In other programs, you'll see the "Anti-aliasing" selection of "2x2, 3x3, 4x4", etc, and that's bascially the "oversampling" you're setting above. Hope it helps... Kevin Cazabon "Kees van Drongelen / To: image-sig@python.org VisualSpace" cc: (bcc: Kevin Cazabon/sienna/gig) 05/11/2001 10:00 AM Hi there, I'am new to pil and trying to create images dynamically in zope: I believe pil supports antialiasing. The thing is I can draw things but not smooth enough: please! does anybody knows what i'am doing wrong? ################################################## # draw a smooth circle ################################################## import Image, ImageDraw dxy=100,100 bgcolor=255,0,0 pencolor=255,255,255 fillcolor=0,0,255 im = Image.new("RGBA",(dxy),(bgcolor)) ########### draw something draw = ImageDraw.Draw(im) draw.ellipse((10,10, 90,90), outline=pencolor, fill=fillcolor) del draw im.save('output.png') -- |||||||||||||||||||||||||||||||||||| VisualSpace grafische en interactieve vormgeving Krelagestraat 34 2012 CT Haarlem T 023 532 33 66 F 023 532 33 04 http://www.visualspace.nl |||||||||||||||||||||||||||||||||||| _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig From gregc@cgl.ucsf.EDU Sat May 12 01:42:30 2001 From: gregc@cgl.ucsf.EDU (Greg Couch) Date: Fri, 11 May 2001 17:42:30 -0700 (PDT) Subject: [Image-SIG] patch for more TIFF tags when saving TIFF images Message-ID: <200105120042.RAA426965@socrates.cgl.ucsf.edu> Then enclosed patch adds support for more TIFF tags, namely the Artist, Copyright, DateTime, ResolutionUnit, Software, XResolution and YResolution tags. The trickiest part was adding support for TIFF rational numbers. Hope this makes it into the next release, Greg Couch UCSF Computer Graphics Lab gregc@cgl.ucsf.edu =================================================================== RCS file: RCS/TiffImagePlugin.py,v retrieving revision 1.1 diff -c -r1.1 TiffImagePlugin.py *** TiffImagePlugin.py 2001/05/11 23:37:24 1.1 --- TiffImagePlugin.py 2001/05/12 00:26:56 *************** *** 66,77 **** --- 66,84 ---- SAMPLESPERPIXEL = 277 ROWSPERSTRIP = 278 STRIPBYTECOUNTS = 279 + X_RESOLUTION = 282 + Y_RESOLUTION = 283 PLANAR_CONFIGURATION = 284 + RESOLUTION_UNIT = 296 + SOFTWARE = 305 + DATE_TIME = 306 + ARTIST = 315 PREDICTOR = 317 COLORMAP = 320 EXTRASAMPLES = 338 SAMPLEFORMAT = 339 JPEGTABLES = 347 + COPYRIGHT = 33432 IPTC_NAA_CHUNK = 33723 # newsphoto properties PHOTOSHOP_CHUNK = 34377 # photoshop properties *************** *** 313,318 **** --- 320,328 ---- if tag == STRIPOFFSETS: stripoffsets = len(directory) typ = 4 # to avoid catch-22 + elif tag in (X_RESOLUTION, Y_RESOLUTION): + # identify rational data fields + typ = 5 else: typ = 3 for v in value: *************** *** 329,335 **** elif len(data) < 4: append((tag, typ, len(value), data + (4-len(data))*"\0", "")) else: ! append((tag, typ, len(value), o32(offset), data)) offset = offset + len(data) if offset & 1: offset = offset + 1 # word padding --- 339,348 ---- elif len(data) < 4: append((tag, typ, len(value), data + (4-len(data))*"\0", "")) else: ! count = len(value) ! if typ == 5: ! count = count / 2 # adjust for rational data field ! append((tag, typ, count, o32(offset), data)) offset = offset + len(data) if offset & 1: offset = offset + 1 # word padding *************** *** 551,556 **** --- 564,579 ---- "LAB": ("LAB", 8, 1, (8,8,8), None), } + def _cvt_res(value): + # convert value to TIFF rational number -- (numerator, denominator) + if type(value) in (type([]), type(())): + assert(len(value) % 2 == 0) + return value + if type(value) == type(1): + return (value, 1) + value = float(value) + return (int(value * 65536), 65536) + def _save(im, fp, filename): try: *************** *** 566,573 **** --- 589,626 ---- ifd[IMAGEWIDTH] = im.size[0] ifd[IMAGELENGTH] = im.size[1] + # additions written by Greg Couch, gregc@cgl.ucsf.edu + # inspired by image-sig posting from Kevin Cazabon, kcazabon@home.com + if hasattr(im, 'tag'): + # preserve tags from original TIFF image file + for key in (RESOLUTION_UNIT, X_RESOLUTION, Y_RESOLUTION): + if im.tag.tagdata.has_key(key): + ifd[key] = im.tag.tagdata.get(key) if im.encoderinfo.has_key("description"): ifd[IMAGEDESCRIPTION] = im.encoderinfo["description"] + if im.encoderinfo.has_key("resolution"): + ifd[X_RESOLUTION] = ifd[Y_RESOLUTION] \ + = _cvt_res(im.encoderinfo["resolution"]) + if im.encoderinfo.has_key("x resolution"): + ifd[X_RESOLUTION] = _cvt_res(im.encoderinfo["x resolution"]) + if im.encoderinfo.has_key("y resolution"): + ifd[Y_RESOLUTION] = _cvt_res(im.encoderinfo["y resolution"]) + if im.encoderinfo.has_key("resolution unit"): + unit = im.encoderinfo["resolution unit"] + if unit == "inch": + ifd[RESOLUTION_UNIT] = 2 + elif unit == "cm" or unit == "centimeter": + ifd[RESOLUTION_UNIT] = 3 + else: + ifd[RESOLUTION_UNIT] = 1 + if im.encoderinfo.has_key("software"): + ifd[SOFTWARE] = im.encoderinfo["software"] + if im.encoderinfo.has_key("date time"): + ifd[DATE_TIME] = im.encoderinfo["date time"] + if im.encoderinfo.has_key("artist"): + ifd[ARTIST] = im.encoderinfo["artist"] + if im.encoderinfo.has_key("copyright"): + ifd[COPYRIGHT] = im.encoderinfo["copyright"] if bits != (1,): ifd[BITSPERSAMPLE] = bits From kees@visualspace.nl Mon May 14 09:53:18 2001 From: kees@visualspace.nl (Kees van Drongelen / VisualSpace) Date: Mon, 14 May 2001 10:53:18 +0200 Subject: [Image-SIG] antialiasing in pil -2 In-Reply-To: References: Message-ID: Thanks Kevin, It works for filled objects. With outlined objects the line of 1 pixel is too thin. Do you know how-to manipulate the outline thickness? anyway thanks for your comment. Kees van Drongelen. # dxy=100 antialiasing=1 scale=4 if antialiasing: im=im.resize((dxy[0]*scale, dxy[1]*scale), Image.NEAREST) im=im.resize((dxy), Image.BICUBIC) # >"Anti-Aliasing" by definition is performed by rendering at a higher >resolution and downsampling using interpolation. I'm not sure if PIL can >automatically do this for you, but it's not hard to do yourself: > >-render at 2x, 3x, 4x, or higher resolution than you need >-downsample the image using "bicubic" to the real size > >In other programs, you'll see the "Anti-aliasing" selection of "2x2, 3x3, >4x4", etc, and that's bascially the "oversampling" you're setting above. > >Hope it helps... > >Kevin Cazabon > -- |||||||||||||||||||||||||||||||||||| VisualSpace grafische en interactieve vormgeving Krelagestraat 34 2012 CT Haarlem T 023 532 33 66 F 023 532 33 04 http://www.visualspace.nl |||||||||||||||||||||||||||||||||||| From Kevin.Cazabon@gretag.com Mon May 14 15:54:14 2001 From: Kevin.Cazabon@gretag.com (Kevin.Cazabon@gretag.com) Date: Mon, 14 May 2001 08:54:14 -0600 Subject: [Image-SIG] antialiasing in pil -2 Message-ID: Hi Kees; The sample code you provide doesn't really perform anti-aliasing as I had suggested... try something like this instead, and it will probably give you a better/smoother result: # dxy=100 antialiasing=1 scale=4 if antialiasing: # create the ORIGINAL image at scale* resolution, don't size up an already-created image # this way, you have finer detail that will result in smoother anti-aliasing im = create_im(scale*dxy, scale*dxy) else: im = create_im(dxy, dxy, scale) if antialiasing: im = im.resize((dxy), Image.BICUBIC) def create_im (width, height, scale=1): im = Image.new(width, height) object_size = object_size*scale # draw your objects... return im # Not much of a change above, but rendering all your data at scale* resolution then scaling down with BICUBIC will create much smoother results than scaling up using NEAREST then scaling down with BICUBIC. The latter will work, but will provide minimal anti-aliasing. As for 1-pixel wide lines... if they're rendered at scale* the width you want them to be when they're done, they'll be "OK", but 1-pixel anti-aliased lines will always fade in/out. I'd suggest that you set 1-pixel lines to be something like 1.5 pixels so that they show up better. At 4* res, that would be 6 pixels wide. I'm not sure how you'd set the line width in Imagedraw, I've never tried it. Kevin Cazabon Kees van Drongelen / To: Kevin.Cazabon@gretag.com VisualSpace cc: image-sig@python.org 05/14/2001 02:53 AM Thanks Kevin, It works for filled objects. With outlined objects the line of 1 pixel is too thin. Do you know how-to manipulate the outline thickness? anyway thanks for your comment. Kees van Drongelen. # dxy=100 antialiasing=1 scale=4 if antialiasing: im=im.resize((dxy[0]*scale, dxy[1]*scale), Image.NEAREST) im=im.resize((dxy), Image.BICUBIC) # >"Anti-Aliasing" by definition is performed by rendering at a higher >resolution and downsampling using interpolation. I'm not sure if PIL can >automatically do this for you, but it's not hard to do yourself: > >-render at 2x, 3x, 4x, or higher resolution than you need >-downsample the image using "bicubic" to the real size > >In other programs, you'll see the "Anti-aliasing" selection of "2x2, 3x3, >4x4", etc, and that's bascially the "oversampling" you're setting above. > >Hope it helps... > >Kevin Cazabon > -- |||||||||||||||||||||||||||||||||||| VisualSpace grafische en interactieve vormgeving Krelagestraat 34 2012 CT Haarlem T 023 532 33 66 F 023 532 33 04 http://www.visualspace.nl |||||||||||||||||||||||||||||||||||| From olk@olk.co.kr Fri May 18 18:08:35 2001 From: olk@olk.co.kr (¿Â¶óÀÎÄÚ¸®¾Æ) Date: Sat, 19 May 2001 02:08:35 +0900 Subject: [Image-SIG] image-sig´Ô ¾È³çÇϼ¼¿ä? Message-ID: <3W-POP3-AABCfcMHMSs0000bd60@3w-pop3-aa.korea.com> PEhUTUw+DQo8SEVBRD4NCjxNRVRBIE5BTUU9IkdFTkVSQVRPUiIgQ29udGVudD0iTWljcm9z b2Z0IERIVE1MIEVkaXRpbmcgQ29udHJvbCI+DQo8VElUTEU+PC9USVRMRT4NCjwvSEVBRD4N CjxCT0RZPg0KPFA+PEZPTlQgY29sb3I9IzAwODAwMCBmYWNlPbG8uLLDvCBzaXplPTI+osQg v8C0w8DHIMCvuNMgosU8L0ZPTlQ+PC9QPg0KPFA+PEZPTlQgZmFjZT2xvLiyw7wgc2l6ZT0y PjxGT05UIGNvbG9yPSMwMDAwODA+oeGw+r3Dv+U8QlI+PC9GT05UPjxGT05UIHNpemU9Mz5B IGdpcmwgDQpnb3QgYW4gZW5nYWdlbWVudCByaW5nLCBhbmQgd291bGQgc2VpemUgZXZlcnkg b3Bwb3J0dW5pdHkgPC9GT05UPjwvRk9OVD48Rk9OVCANCmZhY2U9sby4ssO8IHNpemU9Mj48 Rk9OVCBzaXplPTM+Zm9yIDxCUj5jYWxsaW5nIGF0dGVudGlvbiB0byBpdC4mbmJzcDsgPEJS PkluIGEgDQpncm91cCB3aXRoIGdpcmwgZnJpZW5kcyBubyBvbmUgbm90aWNlZCBpdC4mbmJz cDsgRmluYWxseSB3aGVuIGhlcjxCUj5mcmllbmRzIA0Kd2VyZSBzaXR0aW5nIGFyb3VuZCB0 YWxraW5nLCBzaGUgZ290IHVwIHN1ZGRlbmx5IGFuZCBzYWlkLCA8QlI+Ikl0J3MgYXdmdWxs eSBob3QgDQ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beehive.de Thu May 17 15:34:38 2001 From: hans@beehive.de (hans) Date: Thu, 17 May 2001 15:34:38 +0100 Subject: [Image-SIG] PIL 1.1.2 install without "_imaging.pyd" & no C compiler Message-ID: <3B03E17D.2DD8ABC@beehive.de> System: WinNT workstation, would like to install 1.1.2 into ZOPE (hope png problems vanish) to enhance our MetaPublisher w thumbnails. Already installed 1.1.1 (install instructions for zope-products also using PIL were hard to understand for a newbie, now i know just copy files). PIL1.1.2 doesn't come right out of the box (prebuilt), seems i need to generate something like "_imaging.pyd", which i can't (no Visual Studio, no C compiler). Remedies to that would be most welcome. :-) From benc@rehame.com Tue May 22 13:04:15 2001 From: benc@rehame.com (Ben Catanzariti) Date: Tue, 22 May 2001 22:04:15 +1000 Subject: [Image-SIG] Compression for TIF files Message-ID: Hi, Just like start by stating PIL is a fantastic product ... I have been reading the documentation and just wanted to find if there is a workaroun= d to not being able to write compressed tif files ... i need to publish 1 b= it images to a web page ... (I cannot use png files or gifs at the moment as the java applet I am using to display the images does not currently suppo= rt them) ... kind regards _______________________________________ Ben Cantanzariti Web Research and Development Manager Rehame - News You Need=99 Ph: +61 (0)3 9646 6966 Fx: +61 (0)3 9646 6928 b.e.n.c.@.r.e.h.a.m.e...c.o.m ICQ# 3227045 _______________________________________ From Kevin.Cazabon@gretag.com Tue May 22 19:30:01 2001 From: Kevin.Cazabon@gretag.com (Kevin.Cazabon@gretag.com) Date: Tue, 22 May 2001 12:30:01 -0600 Subject: [Image-SIG] Compression for TIF files Message-ID: I believe that the reason that PIL doesn't include LZW compression is a= licensing issue... LZW must be licensed for "encoding", but not for "decoding" (I think), similar to GIF. LZW is the only common compressi= on scheme for TIFF, although not the only one. TIFF also supports JPEG compression, however it's not widely supported by other applications (s= uch as Photoshop), so there hasn't been a big push to implement it. Sorry... not very helpful I know. Kevin Cazabon = =20 "Ben = =20 Catanzariti" To: image-sig@python.org = =20 Subject: [Image-SIG] Compr= ession for TIF files =20 = =20 05/22/2001 = =20 06:04 AM = =20 = =20 = =20 = Hi, Just like start by stating PIL is a fantastic product ... I have been reading the documentation and just wanted to find if there is a workaro= und to not being able to write compressed tif files ... i need to publish 1= bit images to a web page ... (I cannot use png files or gifs at the moment = as the java applet I am using to display the images does not currently sup= port them) ... kind regards _______________________________________ Ben Cantanzariti Web Research and Development Manager Rehame - News You Need? Ph: +61 (0)3 9646 6966 Fx: +61 (0)3 9646 6928 b.e.n.c.@.r.e.h.a.m.e...c.o.m ICQ# 3227045 _______________________________________ _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig = From benc@rehame.com Wed May 23 01:21:12 2001 From: benc@rehame.com (Ben Catanzariti) Date: Wed, 23 May 2001 10:21:12 +1000 Subject: [Image-SIG] Compression for TIF files In-Reply-To: Message-ID: Thanks for that Kevin Do you know if PIL be supporting any compression standards ... ie. huffman (although I think is owned ny Unisys??), CCITT3 etc? cheers Ben Catanzariti -----Original Message----- From: Kevin.Cazabon@gretag.com [mailto:Kevin.Cazabon@gretag.com] Sent: Wednesday, 23 May 2001 4:30 AM To: Ben Catanzariti Cc: image-sig@python.org Subject: Re: [Image-SIG] Compression for TIF files I believe that the reason that PIL doesn't include LZW compression is a licensing issue... LZW must be licensed for "encoding", but not for "decoding" (I think), similar to GIF. LZW is the only common compression scheme for TIFF, although not the only one. TIFF also supports JPEG compression, however it's not widely supported by other applications (such as Photoshop), so there hasn't been a big push to implement it. Sorry... not very helpful I know. Kevin Cazabon "Ben Catanzariti" To: image-sig@python.org Subject: [Image-SIG] Compression for TIF files 05/22/2001 06:04 AM Hi, Just like start by stating PIL is a fantastic product ... I have been reading the documentation and just wanted to find if there is a workaround to not being able to write compressed tif files ... i need to publish 1 bit images to a web page ... (I cannot use png files or gifs at the moment as the java applet I am using to display the images does not currently support them) ... kind regards _______________________________________ Ben Cantanzariti Web Research and Development Manager Rehame - News You Need? Ph: +61 (0)3 9646 6966 Fx: +61 (0)3 9646 6928 b.e.n.c.@.r.e.h.a.m.e...c.o.m ICQ# 3227045 _______________________________________ _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig From othello@javanet.com Wed May 23 14:09:20 2001 From: othello@javanet.com (Raymond Hettinger) Date: Wed, 23 May 2001 09:09:20 -0400 Subject: [Image-SIG] PIL 1.1.2 Message-ID: <3B0BB680.2C907DDA@javanet.com> Does anyone know where I can find Win32 binaries for PIL 1.1.2 so that I can get it to work with Python 2.1? Raymond othello@javanet.com From King-Fu_Hii@notes.teradyne.com Fri May 25 17:01:52 2001 From: King-Fu_Hii@notes.teradyne.com (King-Fu_Hii@notes.teradyne.com) Date: Fri, 25 May 2001 12:01:52 -0400 Subject: [Image-SIG] some technical support Message-ID: Dear Sir/Mdm, I am using python 2.01, I would like to use the Python Imaging Library to do some imaging processes, the image that i have is from a digital camera and it has 12 bits digital output. The image file format is .tif When i run the imaging capture software that support the camera, i can set it to either 8 grayscale, 16 graycale, rgb 24 bits. But, for my application i would to have the 16 grayscale (16 bits), now since the camera output is 12 bits (it actually trunscated the last for bits), so really actually i am getting is 12 bits depth image. Now, my problem is, when i load it up in python, it only tells me that it is a 8 bits tiff file, and i have no clues what is going on. Please help!!! Following are several additional questions that i would like to ask: (1) Could it be the 12 bits is packed in a pixel? (2) If so, how do I unpacked them to get 12 bits values? (3) Or, it is really something else? If so, what could it be??? (4) Any script examples that i can refer to?? In case my work email doesn't work, please reply at khii0@pop.uky.edu. I REALLY APPRECIATE YOUR TIME, CONCERNS, ANSWER, AND HELP! Thanks a thousand! King-Fu Hii (Teradyne, TCS) Tel: 603 879-3376 From julian@essaustin.com Fri May 25 21:48:49 2001 From: julian@essaustin.com (Julian Humphries) Date: Fri, 25 May 2001 15:48:49 -0500 Subject: [Image-SIG] 16 bit TIFF's, SAMPLEFORMAT tag Message-ID: <3B0EC531.3712CBA@essaustin.com> I regularly use 16 bpp TIFF files and was having problems opening simple unsigned integer grayscale TIFF's with PIL 1.1.1. I took a look at TiffImagePlugin.py and noticed that the I:16 format was recognized only if the SAMPLEFORMAT tag (339) was '2'. Upon further research, this seemed odd, the default for the tag is 1 (unsigned integer) and many programs leave off the tag when saving 16 bit TIFF's. The code later in the module assigns a default of '1' as well, assuring the file won't be recognized. My question is whether there is a reason for only recognizing type '2' which is a "two s complement signed integer data" according to Adobe. I tried changing/and adding a recognized format of (1,1,(16,),()) as I;16 and things seemed to work but I didn't exercise PIL very much. Any thoughts or suggestions? Julian Humphries University of Texas P.S. PIL 1.1.1, Python 1.5.2, on PC with NT4 From akhar@videotron.ca Sun May 27 05:44:29 2001 From: akhar@videotron.ca (akhar) Date: Sat, 26 May 2001 21:44:29 -0700 Subject: [Image-SIG] how can I convert an image into a matrix? Message-ID: how can I convert an image into a matrix with the associated pixel colour value ? I tried playing around with PIL and Numeric but I don't get anything but error messages I tried this: Import Image, ImageChops, Numeric im = Image.open("c:/testimg.jpg) def ImageToArray(i): a = Numeric.array(i._tostring(), "b") a.shape = i.size[1], i.size[0] return a matrix = ImageToArray(im) all I get is this: "Traceback (innermost last): File "", line 1, in ? File "", line 2, in imgtoarray AttributeError: 'JpegImageFile' instance has no attribute '_tostring' >>> " And while I am at it how do I use PIL to write images from a stream? Regards Stephane From Lewisjwl@aol.com Tue May 29 01:40:05 2001 From: Lewisjwl@aol.com (Lewisjwl@aol.com) Date: Mon, 28 May 2001 20:40:05 EDT Subject: [Image-SIG] numpy installation Message-ID: <62.f30119f.284449e5@aol.com> --part1_62.f30119f.284449e5_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Good morning Windows98 (sorry) PYTHON 2.0 installed UNZIP distribution where do I put it? thanks jwl --part1_62.f30119f.284449e5_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: 7bit Good morning

Windows98 (sorry)
PYTHON 2.0 installed
UNZIP distribution

where do I put it?

thanks
jwl
--part1_62.f30119f.284449e5_boundary-- From klimek@grc.nasa.gov Tue May 29 18:40:07 2001 From: klimek@grc.nasa.gov (Bob Klimek) Date: Tue, 29 May 2001 13:40:07 -0400 Subject: [Image-SIG] 16 bit TIFF's, SAMPLEFORMAT tag In-Reply-To: <3B0EC531.3712CBA@essaustin.com> Message-ID: <4.2.2.20010529132909.01e857e8@parrot.grc.nasa.gov> This (16-bit) is a capability would be useful for me too, but one reason I believe why this is not implemented is that rest of PIL supports only 8-bit grayscale or 24-bit color images. Many of the filtering routines (at least last time I checked) were hard coded for 8-bit images. As such it would be incompatible with rest of PIL. My guess, anyway. Bob At 03:48 PM 5/25/2001 -0500, you wrote: >I regularly use 16 bpp TIFF files and was having problems opening simple >unsigned integer grayscale TIFF's with PIL 1.1.1. I took a look at >TiffImagePlugin.py and noticed that the I:16 format was recognized only >if the SAMPLEFORMAT tag (339) was '2'. Upon further research, this >seemed odd, the default for the tag is 1 (unsigned integer) and many >programs leave off the tag when saving 16 bit TIFF's. The code later >in the module assigns a default of '1' as well, assuring the file won't >be recognized. > >My question is whether there is a reason for only recognizing type '2' >which is a "two s complement signed integer data" according to Adobe. I >tried changing/and adding a recognized format of (1,1,(16,),()) as I;16 >and things seemed to work but I didn't exercise PIL very much. > >Any thoughts or suggestions? > >Julian Humphries >University of Texas > >P.S. PIL 1.1.1, Python 1.5.2, on PC with NT4 > >_______________________________________________ >Image-SIG maillist - Image-SIG@python.org >http://mail.python.org/mailman/listinfo/image-sig