From jesse@spine.com Sun Aug 5 06:33:05 2001 From: jesse@spine.com (Jesse Montrose) Date: Sat, 4 Aug 2001 22:33:05 -0700 Subject: [Image-SIG] Font Support in PIL In-Reply-To: <001b01bfdc5a$b74e69c0$16107118@rct1.bc.wave.home.com>; from kcazabon@home.com on Thu, Jun 22, 2000 at 08:01:16AM -0700 References: <00062112283606.00981@caren.cec> <001b01bfdc5a$b74e69c0$16107118@rct1.bc.wave.home.com> Message-ID: <20010804223305.A2396@jaw.spine.com> thanks for putting up those fonts, Kevin! i'm having a "missing space" problem that i'm assuming someone else has run into with font rendering. i've posted the problem output at http://www.spine.com/fontproblem.gif and the script used to generate it is below. it renders the string "one two three" in five different fonts, and three sizes per font. as you can see from the picture, many of the output lines are completely missing their spaces. any tips? #!/usr/bin/python import Image, ImageDraw, ImageFont import types script = [ (255,0,0), "font/Garamond_14_72.pil", "font/Verdana_12_72.pil", "font/Arial_14_72.pil", "font/Bookman Old Style_14_72.pil", "font/Courier New_14_72.pil", (0,255,0), "font/Garamond_24_72.pil", "font/Verdana_22_72.pil", "font/Arial_24_72.pil", "font/Bookman Old Style_24_72.pil", "font/Courier New_24_72.pil", (0,0,255), "font/Garamond_48_72.pil", "font/Verdana_48_72.pil", "font/Arial_48_72.pil", "font/Bookman Old Style_48_72.pil", "font/Courier New_48_72.pil"] colors = [(255,0,0), (0,255,0), (0,0,255)] im = Image.new('RGB', (400, 600)) draw = ImageDraw.Draw(im) testString = "one two three" colorIndex = -1 top = 0 fontName = 0 color = 0 for elem in script: if type(elem) == types.TupleType: color = elem continue else: fontName = elem font = ImageFont.load (fontName) draw.setfont(font) draw.text ((10,top), testString, fill=color) top = top + font.getsize(testString)[1] del draw im.save("fontproblem.gif") On Thu, Jun 22, 2000 at 08:01:16AM -0700, kcazabon wrote: > Hi Loris; > > I while back I created a whole bunch of font sets for PIL because I was > having the same problems. One of the other users (Piers Lauder) kindly > provided FTP space for them, as they're quite large (even when zipped). > > They're available at the following address if you'd like to download > "pre-PIL-ified" fonts. > > http://www.cs.usyd.edu.au/~piers/python/pilfonts.html > > Kevin Cazabon > > > From: "Loris Caren" > To: > Sent: Wednesday, June 21, 2000 4:20 AM > Subject: [Image-SIG] Font Support in PIL > > > > Hello, > > I'm try to create some fonts that can be read by the ImageFont library > using > > bdf2pil. However it dies in font2image saying that Image.core.hex_decoder > > should have two args rather than the one provided. > > I've tried greping for hex_decoder in the library but dont get any hits. > Can > > anybody else get this to work? Without it I can't see how that I can > write > > text using the ImageDraw library. > > > > _______________________________________________ > > Image-SIG maillist - Image-SIG@python.org > > http://www.python.org/mailman/listinfo/image-sig > > -- pgp 14 4b eb f7 62 13 2e c1 jesse montrose print 31 95 e6 82 25 64 7b 43 www.spine.com From jesse@spine.com Sun Aug 5 08:33:13 2001 From: jesse@spine.com (Jesse Montrose) Date: Sun, 5 Aug 2001 00:33:13 -0700 Subject: [Image-SIG] Font Support in PIL (more info) In-Reply-To: <20010804223305.A2396@jaw.spine.com>; from jesse@spine.com on Sat, Aug 04, 2001 at 10:33:05PM -0700 References: <00062112283606.00981@caren.cec> <001b01bfdc5a$b74e69c0$16107118@rct1.bc.wave.home.com> <20010804223305.A2396@jaw.spine.com> Message-ID: <20010805003313.O512@jaw.spine.com> i should have thought to do this test before. it shows a ' ' as zero width! unless anyone has any better ideas, i'm going to try to figure out the .pil format and hexedit the width to something reasonable. jaw portrait> python Python 1.5.2 (#0, Apr 10 2001, 10:03:44) [GCC 2.95.3 20010219 (prerelease)] on linux2 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import Image >>> import ImageFont >>> import ImageDraw >>> font = ImageFont.load("font/Verdana_12_72.pil") >>> font.getsize(' ') (0, 14) >>> font.getsize(' ') (0, 14) >>> font.getsize('.') (4, 14) >>> font.getsize('abc') (22, 14) On Sat, Aug 04, 2001 at 10:33:05PM -0700, Jesse Montrose wrote: > thanks for putting up those fonts, Kevin! > > i'm having a "missing space" problem that i'm assuming someone else > has run into with font rendering. i've posted the problem output at > > http://www.spine.com/fontproblem.gif > > and the script used to generate it is below. it renders the string > "one two three" in five different fonts, and three sizes per font. > > as you can see from the picture, many of the output lines are > completely missing their spaces. > > any tips? > > > > > #!/usr/bin/python > > import Image, ImageDraw, ImageFont > import types > > script = [ > (255,0,0), > "font/Garamond_14_72.pil", > "font/Verdana_12_72.pil", > "font/Arial_14_72.pil", > "font/Bookman Old Style_14_72.pil", > "font/Courier New_14_72.pil", > (0,255,0), > "font/Garamond_24_72.pil", > "font/Verdana_22_72.pil", > "font/Arial_24_72.pil", > "font/Bookman Old Style_24_72.pil", > "font/Courier New_24_72.pil", > (0,0,255), > "font/Garamond_48_72.pil", > "font/Verdana_48_72.pil", > "font/Arial_48_72.pil", > "font/Bookman Old Style_48_72.pil", > "font/Courier New_48_72.pil"] > > colors = [(255,0,0), (0,255,0), (0,0,255)] > > im = Image.new('RGB', (400, 600)) > draw = ImageDraw.Draw(im) > > testString = "one two three" > colorIndex = -1 > > top = 0 > fontName = 0 > color = 0 > for elem in script: > if type(elem) == types.TupleType: > color = elem > continue > else: > fontName = elem > font = ImageFont.load (fontName) > draw.setfont(font) > draw.text ((10,top), > testString, fill=color) > top = top + font.getsize(testString)[1] > > del draw > > im.save("fontproblem.gif") > > > On Thu, Jun 22, 2000 at 08:01:16AM -0700, kcazabon wrote: > > Hi Loris; > > > > I while back I created a whole bunch of font sets for PIL because I was > > having the same problems. One of the other users (Piers Lauder) kindly > > provided FTP space for them, as they're quite large (even when zipped). > > > > They're available at the following address if you'd like to download > > "pre-PIL-ified" fonts. > > > > http://www.cs.usyd.edu.au/~piers/python/pilfonts.html > > > > Kevin Cazabon > > > > > > From: "Loris Caren" > > To: > > Sent: Wednesday, June 21, 2000 4:20 AM > > Subject: [Image-SIG] Font Support in PIL > > > > > > > Hello, > > > I'm try to create some fonts that can be read by the ImageFont library > > using > > > bdf2pil. However it dies in font2image saying that Image.core.hex_decoder > > > should have two args rather than the one provided. > > > I've tried greping for hex_decoder in the library but dont get any hits. > > Can > > > anybody else get this to work? Without it I can't see how that I can > > write > > > text using the ImageDraw library. > > > > > > _______________________________________________ > > > Image-SIG maillist - Image-SIG@python.org > > > http://www.python.org/mailman/listinfo/image-sig > > > > > -- pgp 14 4b eb f7 62 13 2e c1 jesse montrose print 31 95 e6 82 25 64 7b 43 www.spine.com From jesse@spine.com Sun Aug 5 08:47:37 2001 From: jesse@spine.com (Jesse Montrose) Date: Sun, 5 Aug 2001 00:47:37 -0700 Subject: [Image-SIG] Font Support in PIL (workaround) In-Reply-To: <20010805003313.O512@jaw.spine.com>; from jesse@spine.com on Sun, Aug 05, 2001 at 12:33:13AM -0700 References: <00062112283606.00981@caren.cec> <001b01bfdc5a$b74e69c0$16107118@rct1.bc.wave.home.com> <20010804223305.A2396@jaw.spine.com> <20010805003313.O512@jaw.spine.com> Message-ID: <20010805004737.P512@jaw.spine.com> clearly i should have waited until tomorrow to report on this issue instead of boring everyone with the saga, but now that i've begun, i might as well post my workaround... the .pil format is a short plaintext header followed by 256 blocks of 10-shortint structs, and the font width is the first one. i changed byte 0x281 (offset from the start of the binary data, not the beginning of the file) from 0x00 to 0x04 and all is well. kevin, thanks again for the heavy lifting, apart from this minor tweak the files look great and were just what i wanted! now to make them antialiased... ;) On Sun, Aug 05, 2001 at 12:33:13AM -0700, Jesse Montrose wrote: > i should have thought to do this test before. it shows a ' ' as zero > width! unless anyone has any better ideas, i'm going to try to figure > out the .pil format and hexedit the width to something reasonable. > > jaw portrait> python > Python 1.5.2 (#0, Apr 10 2001, 10:03:44) [GCC 2.95.3 20010219 > (prerelease)] on linux2 > Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam > >>> import Image > >>> import ImageFont > >>> import ImageDraw > >>> font = ImageFont.load("font/Verdana_12_72.pil") > >>> font.getsize(' ') > (0, 14) > >>> font.getsize(' ') > (0, 14) > >>> font.getsize('.') > (4, 14) > >>> font.getsize('abc') > (22, 14) > > > > On Sat, Aug 04, 2001 at 10:33:05PM -0700, Jesse Montrose wrote: > > thanks for putting up those fonts, Kevin! > > > > i'm having a "missing space" problem that i'm assuming someone else > > has run into with font rendering. i've posted the problem output at > > > > http://www.spine.com/fontproblem.gif > > > > and the script used to generate it is below. it renders the string > > "one two three" in five different fonts, and three sizes per font. > > > > as you can see from the picture, many of the output lines are > > completely missing their spaces. > > > > any tips? > > > > > > > > > > #!/usr/bin/python > > > > import Image, ImageDraw, ImageFont > > import types > > > > script = [ > > (255,0,0), > > "font/Garamond_14_72.pil", > > "font/Verdana_12_72.pil", > > "font/Arial_14_72.pil", > > "font/Bookman Old Style_14_72.pil", > > "font/Courier New_14_72.pil", > > (0,255,0), > > "font/Garamond_24_72.pil", > > "font/Verdana_22_72.pil", > > "font/Arial_24_72.pil", > > "font/Bookman Old Style_24_72.pil", > > "font/Courier New_24_72.pil", > > (0,0,255), > > "font/Garamond_48_72.pil", > > "font/Verdana_48_72.pil", > > "font/Arial_48_72.pil", > > "font/Bookman Old Style_48_72.pil", > > "font/Courier New_48_72.pil"] > > > > colors = [(255,0,0), (0,255,0), (0,0,255)] > > > > im = Image.new('RGB', (400, 600)) > > draw = ImageDraw.Draw(im) > > > > testString = "one two three" > > colorIndex = -1 > > > > top = 0 > > fontName = 0 > > color = 0 > > for elem in script: > > if type(elem) == types.TupleType: > > color = elem > > continue > > else: > > fontName = elem > > font = ImageFont.load (fontName) > > draw.setfont(font) > > draw.text ((10,top), > > testString, fill=color) > > top = top + font.getsize(testString)[1] > > > > del draw > > > > im.save("fontproblem.gif") > > > > > > On Thu, Jun 22, 2000 at 08:01:16AM -0700, kcazabon wrote: > > > Hi Loris; > > > > > > I while back I created a whole bunch of font sets for PIL because I was > > > having the same problems. One of the other users (Piers Lauder) kindly > > > provided FTP space for them, as they're quite large (even when zipped). > > > > > > They're available at the following address if you'd like to download > > > "pre-PIL-ified" fonts. > > > > > > http://www.cs.usyd.edu.au/~piers/python/pilfonts.html > > > > > > Kevin Cazabon > > > > > > > > > From: "Loris Caren" > > > To: > > > Sent: Wednesday, June 21, 2000 4:20 AM > > > Subject: [Image-SIG] Font Support in PIL > > > > > > > > > > Hello, > > > > I'm try to create some fonts that can be read by the ImageFont library > > > using > > > > bdf2pil. However it dies in font2image saying that Image.core.hex_decoder > > > > should have two args rather than the one provided. > > > > I've tried greping for hex_decoder in the library but dont get any hits. > > > Can > > > > anybody else get this to work? Without it I can't see how that I can > > > write > > > > text using the ImageDraw library. > > > > > > > > _______________________________________________ > > > > Image-SIG maillist - Image-SIG@python.org > > > > http://www.python.org/mailman/listinfo/image-sig > > > > > > > > > -- pgp 14 4b eb f7 62 13 2e c1 jesse montrose print 31 95 e6 82 25 64 7b 43 www.spine.com From john.angelmo@webgiro.com Tue Aug 7 13:29:42 2001 From: john.angelmo@webgiro.com (John Angelmo) Date: Tue, 07 Aug 2001 14:29:42 +0200 Subject: [Image-SIG] PIL and rendering images Message-ID: <3B6FDF36.4010002@webgiro.com> Hi I'm a happy private PIL user For a small homepage for my former highschool I'm using PIL/Python to generate jpeg backgrounds (Just haven't changed JPEG to PNG yet) The code is fairly simple: --- Code --- #!/usr/local/bin/python import os, sys import Image, ImageDraw #def fromhex(s): # s='#cbb99c' # return int(s,16) # fromhex(s[1:3], bla bla # int(s[1:3],16),int(s[3:5],16),int(s[5:7],16) #def crtimg(self,infile,im): s='#cbb99c' t='#a89779' infile= 'background' print infile im = Image.new("RGB",[10,10],(int(s[1:3],16),int(s[3:5],16),int(s[5:7],16))) impix = ImageDraw.Draw(im) impix.point((2,2),(int(t[1:3],16),int(t[3:5],16),int(t[5:7],16))) impix.point((7,2),(int(t[1:3],16),int(t[3:5],16),int(t[5:7],16))) impix.point((2,7),(int(t[1:3],16),int(t[3:5],16),int(t[5:7],16))) impix.point((7,7),(int(t[1:3],16),int(t[3:5],16),int(t[5:7],16))) del impix im.save(infile, "JPEG") --- End Code --- the background looks OK first but if I soom in (about 1500%) I can see that the four dots have created small distortions in the image is there any way to fix this? I also get a strange error when I use PIL: WARNING: Python C API version mismatch for module _imaging: This Python has API version 1010, module _imaging has version 1007. Kind Regards John A -- Webgiro AB --------------------- +46-850640765 Phone +46-850640701 Fax +46-733864346 Cellular RIPE handle: JA4953-RIPE From kuncej@mail.conservation.state.mo.us Tue Aug 7 16:03:08 2001 From: kuncej@mail.conservation.state.mo.us (Jeffrey Kunce) Date: Tue, 07 Aug 2001 10:03:08 -0500 Subject: [Image-SIG] PIL and rendering images Message-ID: > ...I'm using PIL/Python to generate jpeg backgrounds (Just haven't = changed JPEG to PNG yet) That's your problem :-) jpeg uses a lossy compression scheme, i.e. data_in !=3D data_out that's fine for most photos, but no good for diagrams (or anything else with sharp edges that must be reproduced exactly.) Try adding these lines to the end of your program: im.save(infile+'.png') im.save(infile+'.tif') im.save(infile+'.bmp') for q in (20,40,60,80,100): im.save('%s%03d.jpg'%(infile,q), quality=3Dq) im.save(infile+'.gif') You'll find that the PNG, TIF, and BMP files are all perfect.=20 All of those methods save the image exactly as generated The JPG files get better as the quality increases. When you get to Quality=3D100 (no compression) the image is perfect. The GIF file should be perfect, but isn't on my machine. But PIL has always had incomplete support for GIF. -Jeff From jesse@spine.com Tue Aug 7 16:21:37 2001 From: jesse@spine.com (Jesse Montrose) Date: Tue, 7 Aug 2001 08:21:37 -0700 Subject: [Image-SIG] PIL and rendering images In-Reply-To: <3B6FDF36.4010002@webgiro.com>; from john.angelmo@webgiro.com on Tue, Aug 07, 2001 at 02:29:42PM +0200 References: <3B6FDF36.4010002@webgiro.com> Message-ID: <20010807082137.W512@jaw.spine.com> hi there, i'm a happy new PIL user myself. if i understand your question correctly, i think your problem is in the jpeg output. reading in JpegImagePlugin.py: def DQT(self, marker): # # Define quantization table. Support baseline 8-bit tables # only. Note that there might be more than one table in # each marker. # FIXME: The quantization tables can be used to estimate the # compression quality. i take that to mean that the quantization is fixed (invariable) for now (maybe i'll take a crack at it once i'm more familiar with the library in general). lowering jpeg quality loses detail, and gives you artifacts around fine detail areas. for example, i'm using small bitmapped fonts (10 point verdana). saving the file out as a jpg blurs the text more than i'd like but saving the file out as a gif does a poor job of palette selection and dithering (another thing i might take a crack at). i've gotten the best results saving the file out of PIL as a png, then running it through pbm to do the gif conversion: pngtopnm < test.png | ppmquant 256 | ppmtogif > test.gif that turns out to be the best compromise between the photo elements and text elements for my project, your mileage may vary. on another note, as much as it kills me, i'm still not using pngs in websites meant for general consumption because there are still some browsers out there that crash trying to load them (even though it's very few) On Tue, Aug 07, 2001 at 02:29:42PM +0200, John Angelmo wrote: > > Hi I'm a happy private PIL user > For a small homepage for my former highschool I'm using PIL/Python to > generate jpeg backgrounds (Just haven't changed JPEG to PNG yet) > > The code is fairly simple: > #!/usr/local/bin/python > > import os, sys > import Image, ImageDraw > > > #def fromhex(s): > # s='#cbb99c' > # return int(s,16) > # fromhex(s[1:3], bla bla > # int(s[1:3],16),int(s[3:5],16),int(s[5:7],16) > > #def crtimg(self,infile,im): > s='#cbb99c' > t='#a89779' > infile= 'background' > print infile > im = Image.new("RGB",[10,10],(int(s[1:3],16),int(s[3:5],16),int(s[5:7],16))) > > impix = ImageDraw.Draw(im) > impix.point((2,2),(int(t[1:3],16),int(t[3:5],16),int(t[5:7],16))) > impix.point((7,2),(int(t[1:3],16),int(t[3:5],16),int(t[5:7],16))) > impix.point((2,7),(int(t[1:3],16),int(t[3:5],16),int(t[5:7],16))) > impix.point((7,7),(int(t[1:3],16),int(t[3:5],16),int(t[5:7],16))) > del impix > > im.save(infile, "JPEG") > > > > the background looks OK first but if I soom in (about 1500%) I can see > that the four dots have created small distortions in the image is there > any way to fix this? > > I also get a strange error when I use PIL: > > WARNING: Python C API version mismatch for module _imaging: > This Python has API version 1010, module _imaging has version 1007. > > > Kind Regards > > John A > > -- pgp 14 4b eb f7 62 13 2e c1 jesse montrose print 31 95 e6 82 25 64 7b 43 www.spine.com From image-sig@lee-morgan.net Wed Aug 8 04:02:12 2001 From: image-sig@lee-morgan.net (image-sig@lee-morgan.net) Date: 08 Aug 2001 13:02:12 +1000 Subject: [Image-SIG] compiling 1.1.2 on windows Message-ID: Hi, I think this may have been mentioned before but anyway, to get pil to compile on win32(ME) MSVC6 I had to make the following src changes as basestd.h now typedefs UINT32. Cheers Lee *** c:/WINDOWS/TEMP/ImPlatform.h Mon Jul 30 22:38:56 2001 --- c:/WINDOWS/TEMP/ImPlatform.h-153105ooV Mon Jul 30 22:38:56 2001 *************** *** 26,35 **** #define INT16 short /* most things works just fine anyway... */ #endif - #ifdef WIN32 - #include - #else - #if SIZEOF_SHORT == 4 #define INT32 short #elif SIZEOF_INT == 4 --- 26,31 ---- *************** *** 44,53 **** #define INT64 long #endif - #define UINT32 unsigned INT32 - - #endif WIN32 - #if SIZEOF_FLOAT == 4 #define FLOAT32 float #elif SIZEOF_DOUBLE == 4 --- 40,45 ---- *************** *** 64,67 **** #define UINT8 unsigned char #define UINT16 unsigned INT16 ! //#define UINT32 unsigned INT32 --- 56,59 ---- #define UINT8 unsigned char #define UINT16 unsigned INT16 ! #define UINT32 unsigned INT32 *** c:/WINDOWS/TEMP/Dib.c Mon Jul 30 23:09:28 2001 --- c:/WINDOWS/TEMP/Dib.c-153105cRu Mon Jul 30 23:09:28 2001 *************** *** 19,27 **** * See the README file for information on usage and redistribution. */ - #ifdef WIN32 #include "Imaging.h" #include "ImDib.h" --- 19,28 ---- * See the README file for information on usage and redistribution. */ #include "Imaging.h" + + #ifdef WIN32 #include "ImDib.h" -- image-sig From esr@golux.thyrsus.com Thu Aug 9 11:41:17 2001 From: esr@golux.thyrsus.com (Eric S. Raymond) Date: Thu, 9 Aug 2001 06:41:17 -0400 Subject: [Image-SIG] Enhancement patch for PILdriver Message-ID: <200108091041.f79AfHG01748@golux.thyrsus.com> There's no submission address in the PIL distribution. Diffs between last version checked in and current workfile(s): --- README 2001/07/17 06:23:25 1.1 +++ README 2001/07/17 06:26:05 @@ -10,6 +10,13 @@ /F -------------------------------------------------------------------- +pildriver.py + +A class implementing an image-processing calculator for scripts. +Parses lists of commnds (or, called interactively, command-line +arguments) into image loads, transformations, and saves. + +-------------------------------------------------------------------- viewer.py A simple image viewer. Can display all file formats handled by --- pildriver.py 2001/07/17 06:30:12 1.1 +++ pildriver.py 2001/07/17 06:59:12 @@ -22,7 +22,7 @@ space-separated tokens and passed to the execute method. In the method descriptions below, a first line beginning with the string -`usage:' means this method can be invokeed with the token that follows +`usage:' means this method can be invoked with the token that follows it. Following <>-enclosed arguments describe how the method interprets the entries on the stack. Each argument specification begins with a type specification: either `int', `float', `string', or `image'. @@ -209,6 +209,26 @@ image = self.do_pop() self.push(image.filter(filter)) + def do_getbbox(self): + """usage: getbbox + + Push left, upper, right, and lower pixel coordinates of the top image. + """ + bounding_box = self.do_pop().getbbox() + self.push(bounding_box[3]) + self.push(bounding_box[2]) + self.push(bounding_box[1]) + self.push(bounding_box[0]) + + def do_getextrema(self): + """usage: extrema + + Push minimum and maximum pixel values of the top image. + """ + extrema = self.do_pop().extrema() + self.push(extrema[1]) + self.push(extrema[0]) + def do_offset(self): """usage: offset @@ -218,7 +238,6 @@ yoff = int(self.do_pop()) image = self.do_pop() self.push(image.offset(xoff, yoff)) - def do_paste(self): """usage: paste End of diffs. -- Eric S. Raymond Gun Control: The theory that a woman found dead in an alley, raped and strangled with her panty hose, is somehow morally superior to a woman explaining to police how her attacker got that fatal bullet wound. -- L. Neil Smith From john.angelmo@webgiro.com Thu Aug 9 13:48:07 2001 From: john.angelmo@webgiro.com (John Angelmo) Date: Thu, 09 Aug 2001 14:48:07 +0200 Subject: [Image-SIG] Did I miss something? Message-ID: <3B728687.8010504@webgiro.com> One function that I have missed is search and repleace so I can search for a specific color (for example #00FF00) and replace it (with #FF00FF) this would be a great function for theme based pages. Does this function exist and perhaps I have missed something? :) /John -- Webgiro AB --------------------- +46-850640765 Phone +46-850640701 Fax +46-733864346 Cellular RIPE handle: JA4953-RIPE From maximus@peoplepc.fr Fri Aug 17 10:45:35 2001 From: maximus@peoplepc.fr (Jacques Larmet) Date: Fri, 17 Aug 2001 11:45:35 +0200 Subject: [Image-SIG] about PIL... Message-ID: <000201c12702$bfd1cc60$fb02c3d5@hppav> C'est un message de format MIME en plusieurs parties. ------=_NextPart_000_0009_01C12712.20EECCA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable hello, i've downloaded the python imaging library for win32, and i'd like to = create a program to view and create pictures in various formats. i read in a book, about the usage of PIL : "you have to add the = following line : 'import Image, ImageTk', and modify the line 'img =3D = PhotoImage(***)' into 'img =3D ImageTk.PhotoImage(***)'". this doesn't seem to work : i still can't open JPeg, Bitmap or PNG = files. i just can see GIF and PPM files. can you help me ? thanks. romain (sorry, i don't speak english very well, cause i'm not english !) ------=_NextPart_000_0009_01C12712.20EECCA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
hello,
 
i've = downloaded the python=20 imaging library for win32, and i'd like to create a program to view and = create=20 pictures in various formats.
i read in a = book, about the=20 usage of PIL : "you have to add the following line : 'import Image, = ImageTk', and modify the line 'img =3D PhotoImage(***)' into 'img =3D=20 ImageTk.PhotoImage(***)'".
this doesn't = seem to work :=20 i still can't open JPeg, Bitmap  or PNG files. i just can see GIF = and PPM=20 files.
can you help = me=20 ?
 
thanks.
 
romain = (sorry, i don't=20 speak english very well, cause i'm not english = !)
------=_NextPart_000_0009_01C12712.20EECCA0-- From Mario.Ruggier@softplumbers.com Mon Aug 20 11:36:41 2001 From: Mario.Ruggier@softplumbers.com (Ruggier, Mario) Date: Mon, 20 Aug 2001 12:36:41 +0200 Subject: [Image-SIG] batch utility to generate buttons from text? Message-ID: <7FDE48022CEFA544878EA148687723DF0FDA14@mqgenevaex01.myqube.com> Hi folks,=20 I wonder if anyone can point me to a utility that takes=20 a string label as input, and combines it with a prepared 'blank'=20 image template, to output an image file for the text button. Other parameters (such as font face, weight, size) may be set directly in the program.=20 Any help appreciated.=20 Best regards, Mario From Ingo@rj.teleinfo.com.br Tue Aug 21 20:23:34 2001 From: Ingo@rj.teleinfo.com.br (Ingo Hoffmann) Date: Tue, 21 Aug 2001 16:23:34 -0300 Subject: [Image-SIG] New graph Message-ID: <7143B4E1C16FD411B7BC000021DE7135150AA0@SRVTELEINFO> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C12A76.C56FE0E0 Content-Type: text/plain; charset="iso-8859-1" Hi everyone, I'm new in Python and want to create a new graphic, like a chart on M$ Excel. How can I do it? Thanks in advance. Regards, Ingo Hoffmann ------_=_NextPart_001_01C12A76.C56FE0E0 Content-Type: text/html; charset="iso-8859-1" New graph

Hi everyone,

I'm new in Python and want to create a new graphic, like a chart on M$ Excel. How can I do it?
Thanks in advance.

Regards,

Ingo Hoffmann

------_=_NextPart_001_01C12A76.C56FE0E0-- From rob@hooft.net Thu Aug 23 16:48:51 2001 From: rob@hooft.net (Rob W. W. Hooft) Date: Thu, 23 Aug 2001 17:48:51 +0200 Subject: [Image-SIG] batch utility to generate buttons from text? In-Reply-To: <7FDE48022CEFA544878EA148687723DF0FDA14@mqgenevaex01.myqube.com> References: <7FDE48022CEFA544878EA148687723DF0FDA14@mqgenevaex01.myqube.com> Message-ID: <15237.9699.864547.634513@temoleh.chem.uu.nl> >>>>> "RM" == Ruggier, Mario writes: RM> Hi folks, I wonder if anyone can point me to a utility that takes RM> a string label as input, and combines it with a prepared 'blank' RM> image template, to output an image file for the text RM> button. Other parameters (such as font face, weight, size) may be RM> set directly in the program. Recently, I did exactly this. I downloaded a few pilfonts, and wrote a special-purpose program to make all the banners. Even though this is highly specialized to my situation, it may help you to figure it out. This uses a PNG file "butbg.png" to read the background image used for the label, and then draws the text in there. It uses the largest of three fonts that will fit the text in the standard label width of 400 pixels. This code also contains a routine to create a color map for the conversion to GIF (which is done using the pbmplus utilities). The map used is the standard 216 color web map. Please be careful with the Unisys license fees if you want to use GIF. Regards, Rob Hooft ---------------------------------------------------- import os from PIL import Image, ImageFont, ImageDraw fonts=[ImageFont.load('/home/hooft/p/pilfonts/New_Fonts/PIL/Arial_100/Arial_32_100.pil'), ImageFont.load('/home/hooft/p/pilfonts/New_Fonts/PIL/Arial_100/Arial_24_100.pil'), ImageFont.load('/home/hooft/p/pilfonts/New_Fonts/PIL/Arial_100/Arial_20_100.pil')] def makemap(): f=open('map.ppm','w') f.write('P3\n216 1\n5\n') for r in range(6): for g in range(6): for b in range(6): f.write('%d %d %d\n'%(r,g,b)) f.close() def make(text,filename,width=400): im=Image.open("butbg.png") if widthwidth-23: raise "Too wide, %d of %d"%(w,width) x=(iw-5)/2-w/2 y=(ih-5)/2-h/2-2 draw.text((x+3,y+3),text,fill=0,font=font) draw.text((x,y),text,fill=(255*256+255)*256+255,font=font) del draw im.save('tmp.ppm','PPM') os.system('ppmquant -fs -map map.ppm tmp.ppm | ppmtogif > %s'%filename) os.unlink('tmp.ppm') if __name__=="__main__": makemap() make('Hi there!','HiThere_txt.gif') -- ===== rob@hooft.net http://www.hooft.net/people/rob/ ===== ===== R&D, Bruker Nonius BV, Delft http://www.nonius.nl/ ===== ===== PGPid 0xFA19277D ================================= Use Linux! ========= From brice.cassagnabere@voxmobili.com Thu Aug 23 17:23:00 2001 From: brice.cassagnabere@voxmobili.com (=?iso-8859-1?Q?Brice_Cassagnab=E8re?=) Date: Thu, 23 Aug 2001 18:23:00 +0200 Subject: [Image-SIG] PB whith PIL and py2exe Message-ID: <004601c12bef$e0b6f7b0$9f01a8c0@priv.voxmobili.com> C'est un message de format MIME en plusieurs parties. ------=_NextPart_000_0043_01C12C00.A3EEC180 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am using python 21 and PIL1.1.2 I have got a littel problem with the Image.py file: In my script version it works without errors; But when I compile my script whith py2exe , I have an error in this = file (Image.py) At this momment the script just call the open method to open an *.bmp. I have got the error : Traceback (most recent call last): File "ui\VoxchatManagerMonitoringNb.pyc", line 146, in EvtMake File "ui\VoxchatManagerReportParserUi.pyc", line 57, in __init__ File "ui\VoxchatManagerMonitoringNb.pyc", line 170, in TraceStat File "PIL\Image.pyc", line 960, in open IOError: cannot identify image file I tried to debug the the Image.py file to see how it works... I think tha the problem is in the fonction preinit() wich is called line = 938 : Before it, the ID list and the OPEN dictionnary are empty. In the = script execution, the fonction preinit() initialize ID (['BMP', ......] = and OPEN (I didn't manage to find how...) .When i execute the compiled = version ( compiled with py2exe) ID ans OPEN are still empty after the = preinit() fonction >>>> the instruction for i in ID is not executed and = I obtain : raise IOError, "cannot identify image file" Do you have a solution (patch) or can you explain me how the preinit() = function works.* Thanks ------=_NextPart_000_0043_01C12C00.A3EEC180 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I am using python 21 and = PIL1.1.2
 
I have got a littel problem with the = Image.py=20 file:
    In my script version = it works=20 without errors;
    But when I compile = my script=20 whith py2exe , I have an error in this file (Image.py)
 
At this momment the script just call = the open=20 method to open an *.bmp.
 
I have got the error :
 
Traceback (most recent call = last):
  File=20 "ui\VoxchatManagerMonitoringNb.pyc", line 146, in EvtMake
  File = "ui\VoxchatManagerReportParserUi.pyc", line 57, in __init__
  = File=20 "ui\VoxchatManagerMonitoringNb.pyc", line 170, in TraceStat
  = File=20 "PIL\Image.pyc", line 960, in open
IOError: cannot identify image=20 file
 
I tried to debug the the Image.py file = to see how=20 it works...
I think tha the problem is in the = fonction=20 preinit() wich is called line 938 : Before it, the ID list and the OPEN=20 dictionnary are empty. In the script execution, the fonction preinit()=20 initialize ID (['BMP', ......]  and OPEN (I didn't manage to find = how...)=20 .When i execute the compiled version ( compiled with py2exe) ID ans OPEN = are=20 still empty after the preinit() fonction >>>> the = instruction for i=20 in ID is not executed and I obtain : raise IOError, "cannot identify = image=20 file"
 
Do you have a solution (patch) or can = you explain=20 me how the preinit() function works.*
Thanks
------=_NextPart_000_0043_01C12C00.A3EEC180-- From schorsch@schorsch.com Thu Aug 23 17:53:58 2001 From: schorsch@schorsch.com (Georg Mischler) Date: Thu, 23 Aug 2001 12:53:58 -0400 (EDT) Subject: [Image-SIG] PB whith PIL and py2exe In-Reply-To: <004601c12bef$e0b6f7b0$9f01a8c0@priv.voxmobili.com> Message-ID: Brice Cassagnab=E8re wrote: > I am using python 21 and PIL1.1.2 > > I have got a littel problem with the Image.py file: > In my script version it works without errors; > But when I compile my script whith py2exe , I have an error in this f= ile (Image.py) > > At this momment the script just call the open method to open an *.bmp. > > I have got the error : > > Traceback (most recent call last): > File "ui\VoxchatManagerMonitoringNb.pyc", line 146, in EvtMake > File "ui\VoxchatManagerReportParserUi.pyc", line 57, in __init__ > File "ui\VoxchatManagerMonitoringNb.pyc", line 170, in TraceStat > File "PIL\Image.pyc", line 960, in open > IOError: cannot identify image file > > I tried to debug the the Image.py file to see how it works... > I think tha the problem is in the fonction preinit() wich is called line = 938 > : Before it, the ID list and the OPEN dictionnary are empty. In the scrip= t > execution, the fonction preinit() initialize ID (['BMP', ......] and OPE= N (I > didn't manage to find how...) .When i execute the compiled version ( comp= iled > with py2exe) ID ans OPEN are still empty after the preinit() fonction >>>= > > the instruction for i in ID is not executed and I obtain : raise IOError, > "cannot identify image file" > > Do you have a solution (patch) or can you explain me how the preinit() > function works.* Thanks The preinit() function is only part of the problem, it works together with the following init() function. In init(), the PIL directory is searched for all files that have a name ending with "*ImagePlugin.py", and those are then imported one by one until one is found that can load your file. The problem is, that in a frozen package, those files can't be found in a directory, but the init() function must get the information about which are available from some other source. I am not aware of a clean solution here. What I did was to hack the init() function as follows. You will also have to instruct py2exe to include all the existing plug-in files in your frozen archive. ---- hacked excerpt from Image.py ---- def init(): "Load all file format drivers." global _initialized if _initialized >=3D 2: return import os, sys # only check directories (including current, if present in the path) rf_plugins =3D [ # gm - ugly hack for pyz packing. "ArgImagePlugin.py", "BmpImagePlugin.py", "CurImagePlugin.py", "DcxImagePlugin.py", "EpsImagePlugin.py", "FliImagePlugin.py", "FpxImagePlugin.py", "GbrImagePlugin.py", "GifImagePlugin.py", "IcoImagePlugin.py", "ImImagePlugin.py", "ImtImagePlugin.py", "IptcImagePlugin.py", "JpegImagePlugin.py", "McIdasImagePlugin.py", "MicImagePlugin.py", "MpegImagePlugin.py", "MspImagePlugin.py", "PcdImagePlugin.py", "PcxImagePlugin.py", "PdfImagePlugin.py", "PixarImagePlugin.py", "PngImagePlugin.py", "PpmImagePlugin.py", "PsdImagePlugin.py", "SgiImagePlugin.py", "SunImagePlugin.py", "TgaImagePlugin.py", "TiffImagePlugin.py", "WmfImagePlugin.py", "XVThumbImagePlugin.py", "XbmImagePlugin.py", "XpmImagePlugin.py", ] for path in filter(os.path.isdir, sys.path): #for file in os.listdir(path): for file in rf_plugins: # gm if file[-14:] =3D=3D "ImagePlugin.py": p, f =3D os.path.split(file) f, e =3D os.path.splitext(f) try: sys.path.insert(0, path) try: #__import__(f, globals(), locals(), []) __import__(f, globals(), locals(), ["PIL"]) # gm finally: del sys.path[0] except ImportError: if DEBUG: print "Image: failed to import", print f, ":", sys.exc_value if OPEN or SAVE: _initialized =3D 2 ---- end of excerpt ---- Not pretty, but it works for me. Note that you have to make sure that the list reflects those plug-ins that you actually have on your system, which may or may not be the same as on mine. Of course, an automatic mechanism for switching to a preset list when freezing PIL would be much better. Maybe someone smarter than me will invent one... Have fun! -schorsch --=20 Georg Mischler -- simulations developer -- schorsch at schorsch.com +schorsch.com+ -- lighting design tools -- http://www.schorsch.com/ From fredrik@pythonware.com Thu Aug 23 19:10:21 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Thu, 23 Aug 2001 20:10:21 +0200 Subject: [Image-SIG] PB whith PIL and py2exe References: <004601c12bef$e0b6f7b0$9f01a8c0@priv.voxmobili.com> Message-ID: <00a701c12bfe$ea037ff0$66fa42d5@hagrid> Brice Cassagnab=E8re wrote: > When i execute the compiled version ( compiled > with py2exe) ID ans OPEN are still empty after > the preinit() fonction the easiest workaround is to explicitly import the drivers you need for your application. for some more info, see: http://www.pythonware.com/products/pil/articles/speeding-up-initializatio= n.htm hope this helps! From deva@prastha.com Sun Aug 26 03:26:50 2001 From: deva@prastha.com (Devaprastha) Date: Sat, 25 Aug 2001 22:26:50 -0400 Subject: [Image-SIG] cannot find -ljpeg Message-ID: <3B885E6A.9050006@prastha.com> I have tried to compile PIL severl times Using versions 1.1, 1.1.1, 1.1.2 - all with same error. I first downloaded/installed the IJG JPEG library (version 6b). I compiled and installed without a problem, but when trying to run the final "make" I get the following error. ("make -f Makefile.pre.in boot" works fine") I'm running RH7.1 & python 2.1 # gcc -shared ./_imaging.o ./decode.o ./encode.o ./map.o ./display.o ./outline.o ./path.o libImaging/libImaging.a -L/usr/local/lib -ljpeg -L/usr/local/lib -lz -o ./_imaging.so # /usr/bin/ld: cannot find -ljpeg # collect2: ld returned 1 exit status # make: *** [_imaging.so] Error 1 TIA From Robw@crawfish.co.uk Tue Aug 28 14:14:29 2001 From: Robw@crawfish.co.uk (=?utf-8?B?Um9iZXJ0IFdhbGtsZXk=?=) Date: Tue, 28 Aug 2001 14:14:29 +0100 Subject: [Image-SIG] =?utf-8?B?UElMIEJ1ZyAtIEltYWdlLnB1dHBpeGVsKCk=?= Message-ID: <61BC4CA61D7CD311B19400A0C9DBF64E50B5CD@NTSERVER> Hello, I noticed Image.putpixel() crashes the python interpretor with some formats of BMP files. It's worth noting the files were created from Adobe Photoshop just in case it generates bmp files in a slightly different manor. The results I had with the following formats are as follows -4 bit non-rle bmp - worked ok -4 bit RLE bmp - appeared to be a problem opening image ( Image.open() ) -8 bit non-rle bmp - CRASHED -8 bit RLE bmp - appeared to be a problem opening image ( Image.open() ) -24 bit non-rle bmp - worked ok Thanks, Robert Walkley. From xistan@yahoo.se Wed Aug 29 11:40:54 2001 From: xistan@yahoo.se (=?iso-8859-1?q?Christian=20Lundh?=) Date: Wed, 29 Aug 2001 12:40:54 +0200 (CEST) Subject: [Image-SIG] Compiling and installing PIL on HP-UX Message-ID: <20010829104054.53258.qmail@web12901.mail.yahoo.com> Hi, I'm trying to build and install PIL on my HP-UX box. I run ActivePython-2.1.1 which compiled and installed almost flawless (a little bit of manual work was needed to make it function properly). I haven't succeded compiling and installing PIL. Is there anyone who has done this? I meet several problems during the process: 1) The libImaging directory and libImaging.a compiles with no errors. It seems to work just fine too. The problems appear when trying next step: > make -f Makefile.pre.in boot results in an error. "No rule to make target /home/lib/python2.1/config/Makefile" I have no such directory (config). Is there supposed to be one? The make process dies after this error and thus I don't get a Makefile and thus I can't run make and build the PIL extension. 2) When trying to compile the sourcefiles (decode.c etc.) using 'cc -Ae' by themselves I get these annoying error messages: cc: "/usr/include/sys/unistd.h", line 223: error 1711: Inconsistent parameter list declaration for "getopt". cc: "/usr/include/sys/unistd.h", line 239: error 1711: Inconsistent parameter list declaration for "getpass". cc: "/usr/include/sys/unistd.h", line 242: error 1711: Inconsistent parameter list declaration for "rename". If I change the compiler options to 'cc -Aa' I get other errors: cc: "Include/longobject.h", line 38: error 1681: Must use +e or -Ae for long long in ANSI mode. Doing as suggested results in: cc: "/home/yy11510/include/zlib.h", line 757: error 1000: Unexpected symbol: "gzseek". This seems to be some kind of imcompability in the header files, but I'm not sure. I would gladly receive any help I can get on this subject. I'm starting to get very frustrated. Thanks in advance /Chris _____________________________________________________ Do You Yahoo!? Ditt_namn@yahoo.se - skaffa en gratis mailadress på http://mail.yahoo.se From xistan@yahoo.se Wed Aug 29 15:27:31 2001 From: xistan@yahoo.se (=?iso-8859-1?q?Christian=20Lundh?=) Date: Wed, 29 Aug 2001 16:27:31 +0200 (CEST) Subject: [Image-SIG] Re: Compiling and installing PIL on HP-UX In-Reply-To: <20010829104054.53258.qmail@web12901.mail.yahoo.com> Message-ID: <20010829142731.19155.qmail@web12907.mail.yahoo.com> Ok, me again Seems as if some problems are solved. It showed that my Python installation wasn't as complete as I thought it was. After creating a directory ~/lib/python2.1/config and rerunning the python installation I managed to get a Makefile from Makefile.pre.in. So far so good. Regarding problem number 2 below: After doing some more research on the subject I have realised that this has nothing to do with python/PIL but is rather a HP related issue. This error seems to come from a conflict between stdio.h and unistd.h. The suggested solution would be to remove any references to stdio.h and recompile. I don't know if I dare to do that though. stdio.h is included from Python.h and I don't feel very good about messing with that file. So I turn to the readers of this list and ask if you have a suggestion on how to proceed? Thanks /Christian --- Christian Lundh wrote: > Hi, > > I'm trying to build and install PIL on my HP-UX box. > I > run ActivePython-2.1.1 which compiled and installed > almost flawless (a little bit of manual work was > needed to make it function properly). I haven't > succeded compiling and installing PIL. Is there > anyone > who has done this? > > I meet several problems during the process: > > 1) The libImaging directory and libImaging.a > compiles > with no errors. It seems to work just fine too. The > problems appear when trying next step: > > > make -f Makefile.pre.in boot > > results in an error. "No rule to make target > /home/lib/python2.1/config/Makefile" > > I have no such directory (config). Is there supposed > to be one? The make process dies after this error > and > thus I don't get a Makefile and thus I can't run > make > and build the PIL extension. > > 2) When trying to compile the sourcefiles (decode.c > etc.) using 'cc -Ae' by themselves I get these > annoying error messages: > > cc: "/usr/include/sys/unistd.h", line 223: error > 1711: > Inconsistent parameter list declaration for > "getopt". > cc: "/usr/include/sys/unistd.h", line 239: error > 1711: > Inconsistent parameter list declaration for > "getpass". > cc: "/usr/include/sys/unistd.h", line 242: error > 1711: > Inconsistent parameter list declaration for > "rename". > > > If I change the compiler options to 'cc -Aa' I get > other errors: > > cc: "Include/longobject.h", line 38: error 1681: > Must > use +e or -Ae for long long in ANSI mode. > > Doing as suggested results in: > cc: "/home/yy11510/include/zlib.h", line 757: error > 1000: Unexpected symbol: "gzseek". > > > This seems to be some kind of imcompability in the > header files, but I'm not sure. > > > I would gladly receive any help I can get on this > subject. I'm starting to get very frustrated. > > Thanks in advance > > /Chris > > > _____________________________________________________ > Do You Yahoo!? > Ditt_namn@yahoo.se - skaffa en gratis mailadress på http://mail.yahoo.se _____________________________________________________ Do You Yahoo!? Ditt_namn@yahoo.se - skaffa en gratis mailadress på http://mail.yahoo.se From ThePloppies@bigpond.com Thu Aug 30 12:06:29 2001 From: ThePloppies@bigpond.com (Tom Harris) Date: Thu, 30 Aug 2001 21:06:29 +1000 Subject: [Image-SIG] 16 bit support Message-ID: <001901c13143$d20e31c0$0301a8c0@funes.home.net> This is a multi-part message in MIME format. ------=_NextPart_000_0016_01C13197.A3309F60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Early days playing with PIL, I have added PGM support to load and save = 16 bit images, is anyone interested in the patch (its only a few lines)? = A question was posted some time ago on this list about the behaviour of = the histogram method on integer images, which went unanswered. Could I = respectfully ask if there is much interest in extending PIL so that = there are working implementations of useful methods such as (for = example) histograms for modes I and F. This raises several = implementation questions, for example it becomes worthwhile caching the = extreme values of the image data, and a histogram of a mode F image = would need to define bin width as well as extremes.=20 A last question, I have not been able to find out anything about the IM = image format supported by the PIL. Even my prized OReilly Encyclopaedia = of graphics File Formats is silent. Could anyone enlighten me? Tom Harris TheNOSPAMPloppies@bigpond.com [remove NOSPAM to reply] ------=_NextPart_000_0016_01C13197.A3309F60 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi
 
Early days playing with PIL, I have = added PGM=20 support to load and save 16 bit images, is anyone interested in the = patch (its=20 only a few lines)?
 
A question was posted some time ago = on this list=20 about the behaviour of the histogram method on integer images, which = went=20 unanswered. Could I respectfully ask if there is much interest in = extending PIL=20 so that there are working implementations of useful methods such as (for = example) histograms for modes I and F. This raises several = implementation=20 questions, for example it becomes worthwhile caching the extreme values = of the=20 image data, and a histogram of a mode F image would need to define bin = width as=20 well as extremes.
 
A last question, I have not been = able to find=20 out anything about the IM image format supported by the PIL. Even my = prized=20 OReilly Encyclopaedia of graphics File Formats is silent. Could anyone = enlighten=20 me?
 
Tom Harris TheNOSPAMPloppies@bigpond.c= om
 [remove=20 NOSPAM to reply]
------=_NextPart_000_0016_01C13197.A3309F60-- From Robw@crawfish.co.uk Thu Aug 30 13:30:30 2001 From: Robw@crawfish.co.uk (Robert Walkley) Date: Thu, 30 Aug 2001 13:30:30 +0100 Subject: [Image-SIG] 16 bit support Message-ID: <61BC4CA61D7CD311B19400A0C9DBF64E50B8A3@NTSERVER> This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C1314F.8ECA7570 Content-Type: text/plain; charset="iso-8859-1" I don't know about 16 bit images, but it would be wonderful to support paletted formats of bmp files, there are bugs in Image.putpixel(), Image.open() amongst others with 8 bit bmps and RLE bitmaps. I can resend the email if anyone didn't recieve it. -----Original Message----- From: Tom Harris [mailto:ThePloppies@bigpond.com] Sent: 30 August 2001 12:06 To: python image sig Subject: [Image-SIG] 16 bit support Hi Early days playing with PIL, I have added PGM support to load and save 16 bit images, is anyone interested in the patch (its only a few lines)? A question was posted some time ago on this list about the behaviour of the histogram method on integer images, which went unanswered. Could I respectfully ask if there is much interest in extending PIL so that there are working implementations of useful methods such as (for example) histograms for modes I and F. This raises several implementation questions, for example it becomes worthwhile caching the extreme values of the image data, and a histogram of a mode F image would need to define bin width as well as extremes. A last question, I have not been able to find out anything about the IM image format supported by the PIL. Even my prized OReilly Encyclopaedia of graphics File Formats is silent. Could anyone enlighten me? Tom Harris TheNOSPAMPloppies@bigpond.com [remove NOSPAM to reply] ------_=_NextPart_001_01C1314F.8ECA7570 Content-Type: text/html; charset="iso-8859-1"
I don't know about 16 bit images, but it would be wonderful to support paletted formats of bmp files, there are bugs in Image.putpixel(), Image.open() amongst others with 8 bit bmps and RLE bitmaps. I can resend the email if anyone didn't recieve it.
-----Original Message-----
From: Tom Harris [mailto:ThePloppies@bigpond.com]
Sent: 30 August 2001 12:06
To: python image sig
Subject: [Image-SIG] 16 bit support

Hi
 
Early days playing with PIL, I have added PGM support to load and save 16 bit images, is anyone interested in the patch (its only a few lines)?
 
A question was posted some time ago on this list about the behaviour of the histogram method on integer images, which went unanswered. Could I respectfully ask if there is much interest in extending PIL so that there are working implementations of useful methods such as (for example) histograms for modes I and F. This raises several implementation questions, for example it becomes worthwhile caching the extreme values of the image data, and a histogram of a mode F image would need to define bin width as well as extremes.
 
A last question, I have not been able to find out anything about the IM image format supported by the PIL. Even my prized OReilly Encyclopaedia of graphics File Formats is silent. Could anyone enlighten me?
 
Tom Harris TheNOSPAMPloppies@bigpond.com
 [remove NOSPAM to reply]
------_=_NextPart_001_01C1314F.8ECA7570-- From marc@bowery.com Thu Aug 30 14:58:22 2001 From: marc@bowery.com (marc lindahl) Date: Thu, 30 Aug 2001 09:58:22 -0400 Subject: [Image-SIG] aliasing on resize or thumnail? Message-ID: Hi, A few of us are comparing PIL versus ImageMagick for a web application of creating thumnails for image archives... We're getting aliasing from PIL while doing this... and it seems that the filter parameters in resize() don't do anything. Anyone have a clue? Here is a web page comparing the two: http://www.bickersfamily.org/Photos/PILvsIM/ From lheld@nanogen.com Thu Aug 30 19:51:39 2001 From: lheld@nanogen.com (Lance Held) Date: Thu, 30 Aug 2001 11:51:39 -0700 Subject: [Image-SIG] compiling PIL on QNX 4.25 Message-ID: <5.1.0.14.2.20010830113747.0428cea0@exchange> --=====================_508105266==_ Content-Type: text/plain; charset="us-ascii"; format=flowed I'm attempting to compile PIL on QNX 4.25 using the Watcom 10.6 compiler. I've successfully compiled and tested the library in libImaging. When I run "make python" (since QNX doesn't seem to support dynamic linking), all the code seems to compile in that I end up with a lib.a file, but I think it is failing at the linking stage. It cannot find libraries 'net', 'dir', and 'm'. What are these and where should they be on the QNX system (are they named differently on QNX?)? I also get a lot of warnings for undefined references. I've included the output from "make python" as an attachment to this post. Any help will be greatly appreciated. TIA, Lance Held Software Engineer - Nanogen, Inc. voice: (858) 410-4740 fax: (858) 410-4848 mailto:lheld@nanogen.com http://www.nanogen.com --=====================_508105266==_ Content-Type: text/plain; charset="us-ascii" cc warning: cc: cannot find library 'net' cc warning: cc: cannot find library 'dir' cc warning: cc: cannot find library 'm' Warning(1028): ImagingDelete_ is an undefined reference Warning(1028): ImagingNew_ is an undefined reference Warning(1028): ImagingFill_ is an undefined reference Warning(1028): ImagingNewArray_ is an undefined reference Warning(1028): ImagingNewBlock_ is an undefined reference Warning(1028): ImagingFillLinearGradient_ is an undefined reference Warning(1028): ImagingFillRadialGradient_ is an undefined reference Warning(1028): ImagingOpenPPM_ is an undefined reference Warning(1028): ImagingBlend_ is an undefined reference Warning(1028): ImagingConvert_ is an undefined reference Warning(1028): ImagingConvert2_ is an undefined reference Warning(1028): ImagingConvertMatrix_ is an undefined reference Warning(1028): ImagingCopy_ is an undefined reference Warning(1028): ImagingCopy2_ is an undefined reference Warning(1028): ImagingCrop_ is an undefined reference Warning(1028): ImagingFilterBlur_ is an undefined reference Warning(1028): ImagingFilterContour_ is an undefined reference Warning(1028): ImagingFilterDetail_ is an undefined reference Warning(1028): ImagingFilterEdgeEnhance_ is an undefined reference Warning(1028): ImagingFilterEdgeEnhanceMore_ is an undefined reference Warning(1028): ImagingFilterEmboss_ is an undefined reference Warning(1028): ImagingFilterFindEdges_ is an undefined reference Warning(1028): ImagingFilterSmooth_ is an undefined reference Warning(1028): ImagingFilterSmoothMore_ is an undefined reference Warning(1028): ImagingFilterSharpen_ is an undefined reference Warning(1028): ImagingFindPacker_ is an undefined reference Warning(1028): ImagingGetHistogram_ is an undefined reference Warning(1028): ImagingHistogramDelete_ is an undefined reference Warning(1028): ImagingOffset_ is an undefined reference Warning(1028): ImagingPaste_ is an undefined reference Warning(1028): ImagingFill2_ is an undefined reference Warning(1028): ImagingPoint_ is an undefined reference Warning(1028): ImagingPointTransform_ is an undefined reference Warning(1028): ImagingQuantize_ is an undefined reference Warning(1028): ImagingFindUnpacker_ is an undefined reference Warning(1028): ImagingPaletteDelete_ is an undefined reference Warning(1028): ImagingPaletteNew_ is an undefined reference Warning(1028): ImagingResize_ is an undefined reference Warning(1028): ImagingRotate90_ is an undefined reference Warning(1028): ImagingRotate270_ is an undefined reference Warning(1028): ImagingRotate180_ is an undefined reference Warning(1028): ImagingRotate_ is an undefined reference Warning(1028): ImagingTransformAffine_ is an undefined reference Warning(1028): ImagingTransformQuad_ is an undefined reference Warning(1028): ImagingFlipLeftRight_ is an undefined reference Warning(1028): ImagingFlipTopBottom_ is an undefined reference Warning(1028): ImagingGetBBox_ is an undefined reference Warning(1028): ImagingGetExtrema_ is an undefined reference Warning(1028): ImagingGetProjection_ is an undefined reference Warning(1028): ImagingGetBand_ is an undefined reference Warning(1028): ImagingPutBand_ is an undefined reference Warning(1028): ImagingNegative_ is an undefined reference Warning(1028): ImagingChopLighter_ is an undefined reference Warning(1028): ImagingChopDarker_ is an undefined reference Warning(1028): ImagingChopDifference_ is an undefined reference Warning(1028): ImagingChopMultiply_ is an undefined reference Warning(1028): ImagingChopScreen_ is an undefined reference Warning(1028): ImagingChopAdd_ is an undefined reference Warning(1028): ImagingChopSubtract_ is an undefined reference Warning(1028): ImagingChopAnd_ is an undefined reference Warning(1028): ImagingChopOr_ is an undefined reference Warning(1028): ImagingChopXor_ is an undefined reference Warning(1028): ImagingChopAddModulo_ is an undefined reference Warning(1028): ImagingChopSubtractModulo_ is an undefined reference Warning(1028): ImagingDrawArc_ is an undefined reference Warning(1028): ImagingDrawBitmap_ is an undefined reference Warning(1028): ImagingDrawChord_ is an undefined reference Warning(1028): ImagingDrawEllipse_ is an undefined reference Warning(1028): ImagingDrawLine_ is an undefined reference Warning(1028): ImagingDrawPoint_ is an undefined reference Warning(1028): ImagingDrawOutline_ is an undefined reference Warning(1028): ImagingDrawPieslice_ is an undefined reference Warning(1028): ImagingDrawPolygon_ is an undefined reference Warning(1028): ImagingDrawRectangle_ is an undefined reference Warning(1028): ImagingEffectMandelbrot_ is an undefined reference Warning(1028): ImagingEffectNoise_ is an undefined reference Warning(1028): ImagingEffectSpread_ is an undefined reference Warning(1028): ImagingCRC32_ is an undefined reference Warning(1028): ImagingSavePPM_ is an undefined reference Warning(1028): ImagingBitDecode_ is an undefined reference Warning(1028): ImagingFliDecode_ is an undefined reference Warning(1028): ImagingGifDecode_ is an undefined reference Warning(1028): ImagingHexDecode_ is an undefined reference Warning(1028): ImagingLzwDecode_ is an undefined reference Warning(1028): ImagingMspDecode_ is an undefined reference Warning(1028): ImagingPackbitsDecode_ is an undefined reference Warning(1028): ImagingPcdDecode_ is an undefined reference Warning(1028): ImagingPcxDecode_ is an undefined reference Warning(1028): ImagingRawDecode_ is an undefined reference Warning(1028): ImagingSunRleDecode_ is an undefined reference Warning(1028): ImagingTgaRleDecode_ is an undefined reference Warning(1028): ImagingXbmDecode_ is an undefined reference Warning(1028): ImagingZipDecode_ is an undefined reference Warning(1028): ImagingJpegDecode_ is an undefined reference Warning(1028): ImagingEpsEncode_ is an undefined reference Warning(1028): ImagingGifEncode_ is an undefined reference Warning(1028): ImagingPcxEncode_ is an undefined reference Warning(1028): ImagingRawEncode_ is an undefined reference Warning(1028): ImagingXbmEncode_ is an undefined reference Warning(1028): ImagingZipEncode_ is an undefined reference Warning(1028): ImagingJpegEncode_ is an undefined reference Warning(1028): ImagingOutlineNew_ is an undefined reference Warning(1028): ImagingOutlineDelete_ is an undefined reference Warning(1028): ImagingOutlineMove_ is an undefined reference Warning(1028): ImagingOutlineLine_ is an undefined reference Warning(1028): ImagingOutlineCurve_ is an undefined reference Warning(1028): ImagingOutlineClose_ is an undefined reference Warning(1028): ImagingOutlineTransform_ is an undefined reference file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingDelete_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingNew_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFill_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingNewArray_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingNewBlock_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFillLinearGradient_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFillRadialGradient_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingOpenPPM_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingBlend_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingConvert2_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingConvertMatrix_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingCopy_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingCopy2_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingCrop_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFilterBlur_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFilterContour_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFilterDetail_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFilterEdgeEnhance_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFilterEdgeEnhanceMore_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFilterEmboss_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFilterFindEdges_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFilterSmooth_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFilterSmoothMore_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFilterSharpen_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFindPacker_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingGetHistogram_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingHistogramDelete_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingOffset_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingPaste_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFill2_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingPoint_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingPointTransform_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingQuantize_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFindUnpacker_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingPaletteDelete_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingPaletteNew_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingResize_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingRotate90_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingRotate270_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingRotate180_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingRotate_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingTransformAffine_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingTransformQuad_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFlipLeftRight_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingFlipTopBottom_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingGetBBox_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingGetExtrema_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingGetProjection_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingGetBand_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingPutBand_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingNegative_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopLighter_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopDarker_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopDifference_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopMultiply_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopScreen_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopAdd_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopSubtract_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopAnd_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopOr_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopXor_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopAddModulo_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingChopSubtractModulo_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingDrawArc_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingDrawBitmap_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingDrawChord_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingDrawEllipse_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingDrawLine_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingDrawPoint_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingDrawOutline_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingDrawPieslice_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingDrawPolygon_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingDrawRectangle_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingEffectMandelbrot_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingEffectNoise_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingEffectSpread_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingCRC32_ file lib.a(/Imaging-1.1.2/_imaging.c): undefined symbol ImagingSavePPM_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingFindUnpacker_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingBitDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingFliDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingGifDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingHexDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingLzwDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingMspDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingPackbitsDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingPcdDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingPcxDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingRawDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingSunRleDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingTgaRleDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingXbmDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingZipDecode_ file lib.a(/Imaging-1.1.2/decode.c): undefined symbol ImagingJpegDecode_ file lib.a(/Imaging-1.1.2/encode.c): undefined symbol ImagingFindPacker_ file lib.a(/Imaging-1.1.2/encode.c): undefined symbol ImagingEpsEncode_ file lib.a(/Imaging-1.1.2/encode.c): undefined symbol ImagingGifEncode_ file lib.a(/Imaging-1.1.2/encode.c): undefined symbol ImagingPcxEncode_ file lib.a(/Imaging-1.1.2/encode.c): undefined symbol ImagingRawEncode_ file lib.a(/Imaging-1.1.2/encode.c): undefined symbol ImagingXbmEncode_ file lib.a(/Imaging-1.1.2/encode.c): undefined symbol ImagingZipEncode_ file lib.a(/Imaging-1.1.2/encode.c): undefined symbol ImagingJpegEncode_ file lib.a(/Imaging-1.1.2/outline.c): undefined symbol ImagingOutlineNew_ file lib.a(/Imaging-1.1.2/outline.c): undefined symbol ImagingOutlineDelete_ file lib.a(/Imaging-1.1.2/outline.c): undefined symbol ImagingOutlineMove_ file lib.a(/Imaging-1.1.2/outline.c): undefined symbol ImagingOutlineLine_ file lib.a(/Imaging-1.1.2/outline.c): undefined symbol ImagingOutlineCurve_ file lib.a(/Imaging-1.1.2/outline.c): undefined symbol ImagingOutlineClose_ file lib.a(/Imaging-1.1.2/outline.c): undefined symbol ImagingOutlineTransform_ cc: /usr/watcom/10.6/bin/wlink exited 1 make: *** [python] Error 1 --=====================_508105266==_-- From adam@newsnipple.com Thu Aug 30 20:30:35 2001 From: adam@newsnipple.com (Adam Haberlach) Date: Thu, 30 Aug 2001 12:30:35 -0700 Subject: [Image-SIG] compiling PIL on QNX 4.25 In-Reply-To: <5.1.0.14.2.20010830113747.0428cea0@exchange>; from lheld@nanogen.com on Thu, Aug 30, 2001 at 11:51:39AM -0700 References: <5.1.0.14.2.20010830113747.0428cea0@exchange> Message-ID: <20010830123035.A18013@newsnipple.com> On Thu, Aug 30, 2001 at 11:51:39AM -0700, Lance Held wrote: > I'm attempting to compile PIL on QNX 4.25 using the Watcom 10.6 > compiler. I've successfully compiled and tested the library in > libImaging. When I run "make python" (since QNX doesn't seem to support > dynamic linking), all the code seems to compile in that I end up with a > lib.a file, but I think it is failing at the linking stage. It cannot find > libraries 'net', 'dir', and 'm'. What are these and where should they be > on the QNX system (are they named differently on QNX?)? I also get a lot > of warnings for undefined references. I've included the output from "make > python" as an attachment to this post. Any help will be greatly appreciated. I'm having trouble compiling PIL on Solaris 8, myself. I get similar errors. Although I'm not having trouble finding the libraries, I end up with several screens of linker output that ends with the following: inflate 0xf4 libImaging/libImaging.a(ZipDecode.o) inflateInit_ 0xa0 libImaging/libImaging.a(ZipDecode.o) inflateEnd 0x494 libImaging/libImaging.a(ZipDecode.o) 0x178 libImaging/libImaging.a(ZipEncode.o) 0x17c libImaging/libImaging.a(ZipEncode.o) deflateInit2_ 0x1a0 libImaging/libImaging.a(ZipEncode.o) deflate 0x6a0 libImaging/libImaging.a(ZipEncode.o) deflate 0x760 libImaging/libImaging.a(ZipEncode.o) ld: fatal: relocations remain against allocatable but non-writable sections collect2: ld returned 1 exit status make: *** [_imaging.so] Error 1 ...for the life of me, I don't know what it means. System Info: gcc version 2.95.3 20010315 (release) Python 2.1.1 (#1, Aug 6 2001, 12:18:02) [GCC 2.95.3 20010315 (release)] on sunos5 Sun Microsystems Inc. SunOS 5.8 Generic February 2000 -- Adam Haberlach | If you drive 10 miles to buy a powerball adam@newsnipple.comm | ticket, your chances of winning are 1/16 | as good as your chances of dying in a car | crash before you get there. From azevedo@passcal.passcal.nmt.edu Thu Aug 30 21:02:11 2001 From: azevedo@passcal.passcal.nmt.edu (Steve Azevedo) Date: Thu, 30 Aug 2001 20:02:11 -0000 Subject: [Image-SIG] compiling PIL on QNX 4.25 In-Reply-To: <20010830123035.A18013@newsnipple.com> Message-ID: <9240000.999201731@piazza.passcal.nmt.edu> I beleive the problem under Solaris is that libImaging.a needs to contain position independent code. I got around this problem by editing the Makefile for libImaging.a to pass the -fpic switch to gcc. ---------------------------------------------------------------------- Steve Azevedo . IRIS/PASSCAL Instrument Center . New Mexico Tech, Research Park . 100 East Road . Socorro NM 87801 . ____________________________________._._.___._______._______________._ 505.835.5078 Office 505.835.5079 FAX azevedo@passcal.nmt.edu http://passcal.nmt.edu/ ____________________________________._._.___._______._______________._ > I'm having trouble compiling PIL on Solaris 8, myself. I get similar > errors. Although I'm not having trouble finding the libraries, I end up > with several screens of linker output that ends with the following: > > inflate 0xf4 > libImaging/libImaging.a(ZipDecode.o) inflateInit_ > 0xa0 libImaging/libImaging.a(ZipDecode.o) inflateEnd > 0x494 libImaging/libImaging.a(ZipDecode.o) > 0x178 libImaging/libImaging.a(ZipEncode.o) > 0x17c libImaging/libImaging.a(ZipEncode.o) deflateInit2_ > 0x1a0 libImaging/libImaging.a(ZipEncode.o) deflate > 0x6a0 libImaging/libImaging.a(ZipEncode.o) deflate > 0x760 libImaging/libImaging.a(ZipEncode.o) ld: fatal: relocations > remain against allocatable but non-writable sections collect2: ld > returned 1 exit status > make: *** [_imaging.so] Error 1 > > > ...for the life of me, I don't know what it means. > > System Info: > gcc version 2.95.3 20010315 (release) > > Python 2.1.1 (#1, Aug 6 2001, 12:18:02) > [GCC 2.95.3 20010315 (release)] on sunos5 > > Sun Microsystems Inc. SunOS 5.8 Generic February 2000 > > > > -- > Adam Haberlach | If you drive 10 miles to buy a powerball > adam@newsnipple.comm | ticket, your chances of winning are 1/16 > | as good as your chances of dying in a car > | crash before you get there. > > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://mail.python.org/mailman/listinfo/image-sig From klimek@grc.nasa.gov Thu Aug 30 22:28:40 2001 From: klimek@grc.nasa.gov (Bob Klimek) Date: Thu, 30 Aug 2001 17:28:40 -0400 Subject: [Image-SIG] 16 bit support In-Reply-To: <001901c13143$d20e31c0$0301a8c0@funes.home.net> Message-ID: <4.2.2.20010830172301.01f0b060@parrot.grc.nasa.gov> Hello Tom, At 09:06 PM 8/30/2001 +1000, you wrote: >Hi > >Early days playing with PIL, I have added PGM support to load and save 16 >bit images, is anyone interested in the patch (its only a few lines)? Yes, I'm interested! Adding this capability would be a nice improvement to PIL. This brings up a few questions. - Can 16-bit TIF files be also loaded? - How do you display the image? I.e. do you display only the top 8-bits or do you keep all of it, interpolating down to 8-bits? - Can you read/write a 16-bit pixel? > >A question was posted some time ago on this list about the behaviour of >the histogram method on integer images, which went unanswered. Could I >respectfully ask if there is much interest in extending PIL so that there >are working implementations of useful methods such as (for example) >histograms for modes I and F. This raises several implementation >questions, for example it becomes worthwhile caching the extreme values of >the image data, and a histogram of a mode F image would need to define bin >width as well as extremes. > Once again I'm interested, especially for the F format. My thinking is that since full support of 16-bit images in PIL would be a big undertaking, since most processing functions are hard-coded for 8-bits. The next best thing would be to read a 16-bit image and convert it to float, then you can do a lot of processing (employing even packages other then PIL), then you convert back to a 16-bit image and display. That's my thinking, anyway. I'm curious, does this procedure sound reasonable or can anyone point out any flaws with this thinking? >A last question, I have not been able to find out anything about the IM >image format supported by the PIL. Even my prized OReilly Encyclopaedia of >graphics File Formats is silent. Could anyone enlighten me? > >Tom Harris TheNOSPAMPloppies@bigpond.com > [remove NOSPAM to reply] From adam@newsnipple.com Thu Aug 30 23:29:29 2001 From: adam@newsnipple.com (Adam Haberlach) Date: Thu, 30 Aug 2001 15:29:29 -0700 Subject: [Image-SIG] compiling PIL on QNX 4.25 In-Reply-To: <9240000.999201731@piazza.passcal.nmt.edu>; from azevedo@passcal.passcal.nmt.edu on Thu, Aug 30, 2001 at 08:02:11PM -0000 References: <20010830123035.A18013@newsnipple.com> <9240000.999201731@piazza.passcal.nmt.edu> Message-ID: <20010830152929.A19590@newsnipple.com> On Thu, Aug 30, 2001 at 08:02:11PM -0000, Steve Azevedo wrote: > > > I beleive the problem under Solaris is that libImaging.a needs to contain > position independent code. I got around this problem by editing the > Makefile for libImaging.a to pass the -fpic switch to gcc. Works like a charm! Thanks! -- Adam Haberlach | If you drive 10 miles to buy a powerball adam@newsnipple.comm | ticket, your chances of winning are 1/16 | as good as your chances of dying in a car | crash before you get there.