From John-Mark Gurney Wed May 3 20:51:03 2000 From: John-Mark Gurney (John-Mark Gurney) Date: Wed, 3 May 2000 12:51:03 -0700 Subject: [Image-SIG] broken configure script... Message-ID: <20000503125103.38770@hydrogen.funkthat.com> When I did a ./configure in Imaging-1.0/libImaging, it didn't check the standard location /usr/local/lib for libjpeg, but that isn't the real bug.. the real bug is that when I do: ./configure --with-jpeg=/usr/local/lib it then fails to find the jpeg library because the configure script didn't include the -L in the Makefile... This is based off of: MD5 (Imaging-1.0.tar.gz) = aa42c8a7eede77a54973a150c90af78a 3822401520 313109 Imaging-1.0.tar.gz -- John-Mark Gurney Voice: +1 408 975 9651 Cu Networking "I say all sorts of useless things." -- cmc From parish@ikb.mavt.ethz.ch Thu May 4 14:20:34 2000 From: parish@ikb.mavt.ethz.ch (Yoav I H Parish) Date: Thu, 04 May 2000 15:20:34 +0200 Subject: [Image-SIG] A small question Message-ID: <39117922.EBA77FA8@ikb.mavt.ethz.ch> Hello, I would like to use the ImageDraw library to draw overlays. If i use the draw.line i can't see the line on the picture. Anybody? thanxinadvance yogi P.s. The ImageDraw docs have the example wrong. It should go something like import Image, ImageDraw, sys im = Image.open("whatever.tif") draw = ImageDraw.Draw(im) draw.line([(0,0), im.size],fill=128) draw.line([(0,im.size[1]), (im.size[0],0)], fill=128) im.save(sys.stdout, "TIFF") From Mark.Scheele@usa.xerox.com Mon May 8 17:55:20 2000 From: Mark.Scheele@usa.xerox.com (Scheele, Mark L) Date: Mon, 08 May 2000 12:55:20 -0400 Subject: [Image-SIG] .TIFF Group4 not available? Message-ID: <4148FB13B35FD211936F0008C74CD98C2C9761@USA4280MS1> Help. Trying to write a simple module to convert a .TIFF to a .JPEG. Keep getting an error: group4 decoder not available: See code below. Repeat. Help. (i.e. how do i make group4 available?) Thanks. Python 1.5.1 (#0, Jun 15 1998, 11:13:40) [MSC 32 bit (Intel)] on win32 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import Image >>> i = Image.open("./testing/large.tif") >>> i.save("new.tif") Traceback (innermost last): File "", line 1, in ? File "c:\py15\Pil\Image.py", line 654, in save self.load() File "c:\py15\Pil\ImageFile.py", line 134, in load d = Image._getdecoder(self.mode, d, a, self.decoderconfig) File "c:\py15\Pil\Image.py", line 227, in _getdecoder raise IOError, "decoder %s not available" % decoder_name IOError: decoder group4 not available --------------------------------------------------------- Mark Scheele mark.scheele@usa.xerox.com From srichter@cbu.edu Tue May 9 16:21:40 2000 From: srichter@cbu.edu (Stephan Richter) Date: Tue, 09 May 2000 10:21:40 -0500 Subject: [Image-SIG] Group4 TIFF Message-ID: <4.3.1.0.20000509102031.00a85db0@mail.cbu.edu> I know that this question was asked many times, but does someone has a Group4 TIFF plug-in for PIL? Alpha quality will do for now. Regards, Stephan -- Stephan Richter - (901) 573-3308 - srichter@cbu.edu CBU - Physics & Chemistry; Framework Web - Web Design & Development PGP Key: 735E C61E 5C64 F430 4F9C 798E DCA2 07E3 E42B 5391 From jason@streetrodstuff.com Mon May 15 15:14:43 2000 From: jason@streetrodstuff.com (Jason Long) Date: Mon, 15 May 2000 10:14:43 -0400 Subject: [Image-SIG] Help w/ resize Message-ID: <20000515101443.A19991@skytrail.columbus.rr.com> Hi, I am a newbie to the PIL library and I need a little help. For the record, I am using Python/PIL on Redhat 6.1 - Python version 1.5.2. Here is my scenario: I have some images of all different sizes that I would like to resize to a size of 275 pixels wide, and I don't care how tall. I want to preserve the aspect ratio, though. I have had success with the thumbnail() function, however the image quality is not very good. I was thinking that I would get better results with resize() since I could specify BILINEAR or BICUBIC filters. I guess I am not exactly sure how to use the resize function correctly for my needs. To summarize, I need to: - resize images of different sizes to (275, x) - generate the best quality I can Basically, I'd like the thumbnail functionality with better output quality. I'm sure I'm simply not doing something correctly. Perhaps a snipet of code would do me best. Thank you very much in advance. Jason -- Jason Long Webmaster http://www.streetrodstuff.com From kingsley@krt.com.au Mon May 15 21:11:19 2000 From: kingsley@krt.com.au (Kingsley) Date: Tue, 16 May 2000 06:11:19 +1000 Subject: [Image-SIG] Re: Image-SIG digest, Vol 1 #273 - 1 msg References: <20000515160027.7C76B1CD7B@dinsdale.python.org> Message-ID: <392059E7.13414EF0@krt.com.au> > To summarize, I need to: > - resize images of different sizes to (275, x) > - generate the best quality I can > > Basically, I'd like the thumbnail functionality with better output quality. > I'm sure I'm simply not doing something correctly. > Perhaps a snipet of code would do me best. Snippety-Snip ### Get some stats from the uploaded image im = Image.open(pict_file_path) pict_hires_x = im.size[0] pict_hires_y = im.size[1] ### ### If the image is too big, resize it to 200x150ish ### if pict_hires_x > 200 or pict_hires_y > 150: newx = 200 newy = 150 if pict_hires_x > pict_hires_y: newy = pict_hires_y * newx / pict_hires_x else: newx = pict_hires_x * newy / pict_hires_y im = im.resize((newx,newy),Image.BICUBIC) im.save(thumb_filename,"JPEG",quality=50,optimize=1) I think you should be able to just change the sizes and fire the sucker up. cheers, -kt -- Kingsley Turner, mailto:kingsley@krt.com.au Mad Dog's Breakfast: The Travel Magazine that doesn't take itself too seriously http://www.MadDogsBreakfast.com From mvmendes@mailcity.com Sat May 20 20:04:06 2000 From: mvmendes@mailcity.com (Marcus Mendes) Date: Sat, 20 May 2000 12:04:06 -0700 Subject: [Image-SIG] Photo Animate Message-ID: Hello I need animate 3 consecutive photos. How can I to do it in Python (or in Zope)? Someone can help me? Thanks. Marcus Mendes Get your FREE Email at http://mailcity.lycos.com Get your PERSONALIZED START PAGE at http://my.lycos.com From srichter@plandepot.com Sat May 20 21:27:36 2000 From: srichter@plandepot.com (Stephan Richter) Date: Sat, 20 May 2000 13:27:36 -0700 Subject: [Image-SIG] Photo Animate In-Reply-To: Message-ID: <4.3.1.0.20000520132447.00aa9870@mail.cbu.edu> At 12:04 PM 5/20/00 -0700, you wrote: >Hello >I need animate 3 consecutive photos. How can I to do it in Python (or in >Zope)? >Someone can help me? PIL allows you to save animated GIFs. You can also write a little Image server in Zope and use an HTTP refresh to get the next picture. Depending on how well versed you are with Zope it should be no problem. But I think that would be an overkill. Animated GIFds are better. I have written an Image server (not complete yet) for Zope I could send you though. Just my 2 cents. Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Web2k - Web Design/Development & Technical Project Management From vsuvorov@cccglobal.com Sun May 21 03:47:00 2000 From: vsuvorov@cccglobal.com (Vadim Suvorov) Date: Sat, 20 May 2000 21:47:00 -0500 Subject: [Image-SIG] PIL problems Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_0000_01BFC2A4.EDC37CE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello, I just started to use PIL 1.01b (of 11/01/99) and have a few problems: 1. I can not read black/white bitmaps ( ... File "C:\Program Files\Python\Lib\PIL\BmpImagePlugin.py", line 136, in _open self._bitmap() File "C:\Program Files\Python\Lib\PIL\BmpImagePlugin.py", line 85, in _bitmap raise IOError, "Unknown BMP header type" IOError: Unknown BMP header type ). I used MS Paint to save file in 1-bit per point mode. 2. I have a bitmap of 3086 x 2775 256 colors. An attempt to use viewer to display it causes Python failure in TK80: PYTHON caused an invalid page fault in module TK80.DLL at 015f:00c8f329. Registers: EAX=00000000 CS=015f EIP=00c8f329 EFLGS=00010206 EBX=1e152a10 SS=0167 ESP=0063f534 EBP=0063f538 ECX=00000000 DS=0167 ESI=004acfe4 FS=441f EDX=0045059c ES=0167 EDI=00450e80 GS=0000 Bytes at CS:EIP: 89 51 08 8b e5 5d c3 55 8b ec 83 ec 34 8b 45 0c Stack dump: 00000000 0063f57c 00cce658 00000000 0045059c 00450e80 004acfe4 00000c0e 00000ad7 0063f5a4 00000000 00000000 0ad70c0e 00000020 00000002 00000000 Is there any limits on what can be viewed? 3. An attempt to process images like: import Image ... fails with message: File "C:\Program Files\Python\Lib\PIL\ImageDraw.py", line 29, in __init__ im.load() File "C:\Program Files\Python\Lib\PIL\ImageFile.py", line 117, in load self.map = Image.core.map(self.filename) File "C:\Program Files\Python\Lib\PIL\Image.py", line 40, in __getattr__ raise ImportError, "The _imaging C module is not installed" ImportError: The _imaging C module is not installed However, import Tkinter import Image ... fixes the situation. I do not understand how this is related (Python-wise). 4. In the same bitmap from 2 (3086 x 2775 256 colors), I tried to draw a line: draw = ImageDraw.Draw(im) draw.line(((0, 0), im.size), fill=128) An operation fails with message: PYTHON caused an invalid page fault in module _IMAGING.DLL at 015f:00d653b0. Registers: EAX=00000000 CS=015f EIP=00d653b0 EFLGS=00010293 EBX=86ae1996 SS=0167 ESP=0063faa0 EBP=000015ae ECX=00000c80 DS=0167 ESI=000009a0 FS=593f EDX=00000000 ES=0167 EDI=00806620 GS=0000 Bytes at CS:EIP: 88 0c 03 85 f6 7c 0c 8b 5c 24 20 03 d3 8b 5c 24 Stack dump: 00806870 00000000 0063fb08 00000000 00d65f1f 00806620 00000001 0000181c 00000001 00000c0e 00000080 00d5421b 00806620 00000000 00000000 00000c0e I appreciate your help, Vadim ------=_NextPart_000_0000_01BFC2A4.EDC37CE0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hello,

I just started to use = PIL 1.01b=20 (of 11/01/99) and have a few problems:

1. I can not read = black/white=20 bitmaps (
...
  File = "C:\Program=20 Files\Python\Lib\PIL\BmpImagePlugin.py", line 136, in=20 _open
    self._bitmap()
  File = "C:\Program=20 Files\Python\Lib\PIL\BmpImagePlugin.py", line 85, in=20 _bitmap
    raise IOError, "Unknown BMP header=20 type"
IOError: Unknown BMP header type

).=20 I used MS Paint to save file in 1-bit per point mode.

2. I have a bitmap of 3086 x 2775 = 256 colors.=20 An attempt to use viewer to display it causes Python failure in=20 TK80:

PYTHON caused an invalid = page fault=20 in
module TK80.DLL at 015f:00c8f329.
Registers:
EAX=3D00000000 = CS=3D015f=20 EIP=3D00c8f329 EFLGS=3D00010206
EBX=3D1e152a10 SS=3D0167 = ESP=3D0063f534=20 EBP=3D0063f538
ECX=3D00000000 DS=3D0167 ESI=3D004acfe4 = FS=3D441f
EDX=3D0045059c=20 ES=3D0167 EDI=3D00450e80 GS=3D0000
Bytes at CS:EIP:
89 51 08 8b e5 = 5d c3 55 8b=20 ec 83 ec 34 8b 45 0c
Stack dump:
00000000 0063f57c 00cce658 = 00000000=20 0045059c 00450e80 004acfe4 00000c0e
00000ad7 0063f5a4 00000000 = 00000000=20 0ad70c0e 00000020 00000002 00000000

Is there any limits on = what can be=20 viewed?

3. An attempt to process images = like:

import Image

...

fails with message:

  File "C:\Program=20 Files\Python\Lib\PIL\ImageDraw.py", line 29, in=20 __init__
    im.load()
  File "C:\Program = Files\Python\Lib\PIL\ImageFile.py", line 117, in = load
   =20 self.map =3D Image.core.map(self.filename)
  File = "C:\Program=20 Files\Python\Lib\PIL\Image.py", line 40, in=20 __getattr__
    raise ImportError, "The _imaging = C module=20 is not installed"
ImportError: The _imaging C module is not=20 installed

However,

import Tkinter
import Image
...

fixes the situation. I do not understand how this is related=20 (Python-wise).

4. In the same bitmap from 2 (3086 x 2775 256 colors), I tried to = draw a=20 line:

draw =3D = ImageDraw.Draw(im)
draw.line(((0, 0),=20 im.size), fill=3D128)

An operation fails with message:

PYTHON caused an invalid page fault in
module = _IMAGING.DLL at 015f:00d653b0.
Registers:
EAX=3D00000000 CS=3D015f = EIP=3D00d653b0 EFLGS=3D00010293
EBX=3D86ae1996 SS=3D0167 = ESP=3D0063faa0=20 EBP=3D000015ae
ECX=3D00000c80 DS=3D0167 ESI=3D000009a0 = FS=3D593f
EDX=3D00000000=20 ES=3D0167 EDI=3D00806620 GS=3D0000
Bytes at CS:EIP:
88 0c 03 85 f6 = 7c 0c 8b 5c=20 24 20 03 d3 8b 5c 24
Stack dump:
00806870 00000000 0063fb08 = 00000000=20 00d65f1f 00806620 00000001 0000181c
00000001 00000c0e 00000080 = 00d5421b=20 00806620 00000000 00000000 00000c0e

I appreciate your help,

Vadim

 

------=_NextPart_000_0000_01BFC2A4.EDC37CE0-- From vsuvorov@cccglobal.com Sun May 21 04:01:49 2000 From: vsuvorov@cccglobal.com (Vadim Suvorov) Date: Sat, 20 May 2000 22:01:49 -0500 Subject: [Image-SIG] PIL performance issue Message-ID: Hello, I have a fairly big bitmap (3086 x 2775 256 colors, about 8.5 MB) in which I need to find pixels of certain color (for example, most of bitmap is black and white, except for 4 red pixels, and 3-5 yellow). I came up (after optimization) with solution like: im = Image.open("myfile.bmp") im.load() xxx = range(im.size[0]); yyy = range(im.size[1]) imx = im.im # for sake of speed, bypass Image's wrapper (7 times faster) coords = {} for iy in yyy: for ix in xxx: c = imx.getpixel((ix, iy)) if c <> 0 and c <> 255: if coords.has_key(c): coords[c].append((ix, iy)) else: coords[c] = [(ix, iy)] print coords but it is still fairly slow (about 50+ seconds on 400 MHz Pentium II). I know there are methods like Point(), but they do not have access to coordinates of the point. Is there any way to speed up the process? Thank you, Vadim From kcaza@cymbolic.com Fri May 26 22:46:10 2000 From: kcaza@cymbolic.com (kcaza@cymbolic.com) Date: Fri, 26 May 2000 14:46:10 -0700 Subject: [Image-SIG] PIL performance issue Message-ID: <882568EB.007795AE.00@mail.cymbolic.com> To do pixel-by-pixel analysis, you may have better luck doing it as a list instead of reading each pixel with getpixel. You can use the .tostring() function to do this. I believe that this will significantly improve your performance. As for the image size... PIL is capable of much higher, so I wouldn't worry about it. I've processed single files that are over 1GB in size using PIL... not the fastest thing in the world, but it worked fine. Kevin Cazabon. "Vadim Suvorov" on 05/20/2000 08:01:49 PM To: image-sig@python.org cc: (bcc: Kevin Cazabon/cymbolic/gig) Subject: [Image-SIG] PIL performance issue Hello, I have a fairly big bitmap (3086 x 2775 256 colors, about 8.5 MB) in which I need to find pixels of certain color (for example, most of bitmap is black and white, except for 4 red pixels, and 3-5 yellow). I came up (after optimization) with solution like: im = Image.open("myfile.bmp") im.load() xxx = range(im.size[0]); yyy = range(im.size[1]) imx = im.im # for sake of speed, bypass Image's wrapper (7 times faster) coords = {} for iy in yyy: for ix in xxx: c = imx.getpixel((ix, iy)) if c <> 0 and c <> 255: if coords.has_key(c): coords[c].append((ix, iy)) else: coords[c] = [(ix, iy)] print coords but it is still fairly slow (about 50+ seconds on 400 MHz Pentium II). I know there are methods like Point(), but they do not have access to coordinates of the point. Is there any way to speed up the process? Thank you, Vadim _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From kcaza@cymbolic.com Fri May 26 23:02:51 2000 From: kcaza@cymbolic.com (kcaza@cymbolic.com) Date: Fri, 26 May 2000 15:02:51 -0700 Subject: [Image-SIG] Help w/ resize Message-ID: <882568EB.00791CED.00@mail.cymbolic.com> Basically, you just need to find out the aspect ratio of the new file at 275 pixels wide, and resize it using that size. It's pretty simple. ############## import Image def BetterThumbnail(im, xmax, ymax): inaspect =float(im.size[0])/ float(im.size[1]) outaspect = float(xmax) / float(ymax) if inaspect > outaspect: # meaning that xmax will be used in resizing, and y will be determined by aspect ratio im = im.resize((xmax, int((float(xmax) / inaspect) + 0.5)), Image.BICUBIC) # round it off, resize with Bicubic else: # meaning that ymax will be used in resizing, and x will be determined by aspect ratio im = im.resize((int((float(ymax) * inaspect) + 0.5), ymax), Image.BICUBIC) return im ################ That should do it for ya... check it out with a couple test images though, it's similar to what I use in my stuff, but not exactly the same. Kevin. Jason Long on 05/15/2000 07:14:43 AM To: image-sig@python.org cc: (bcc: Kevin Cazabon/cymbolic/gig) Subject: [Image-SIG] Help w/ resize Hi, I am a newbie to the PIL library and I need a little help. For the record, I am using Python/PIL on Redhat 6.1 - Python version 1.5.2. Here is my scenario: I have some images of all different sizes that I would like to resize to a size of 275 pixels wide, and I don't care how tall. I want to preserve the aspect ratio, though. I have had success with the thumbnail() function, however the image quality is not very good. I was thinking that I would get better results with resize() since I could specify BILINEAR or BICUBIC filters. I guess I am not exactly sure how to use the resize function correctly for my needs. To summarize, I need to: - resize images of different sizes to (275, x) - generate the best quality I can Basically, I'd like the thumbnail functionality with better output quality. I'm sure I'm simply not doing something correctly. Perhaps a snipet of code would do me best. Thank you very much in advance. Jason -- Jason Long Webmaster http://www.streetrodstuff.com _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://www.python.org/mailman/listinfo/image-sig From srichter@cbu.edu Sun May 28 08:53:49 2000 From: srichter@cbu.edu (Stephan Richter) Date: Sun, 28 May 2000 00:53:49 -0700 Subject: [Image-SIG] Picture Streaming using PIL Message-ID: <4.3.1.0.20000528004713.00a924e0@mail.cbu.edu> Hello everyone, did ever someone try to create a pixel stream, so that a client can start displaying the pixels as soon as they are received? Long Version: My client asked me to write a server client system for the Web that would stream a picture to the client, since some modem connections of her Web site members are still very slow. We will start with black and white TIF files. I was thinking about writing a Java Applet as the client. On the server side I will have Zope with an extension (Product) called ImageServer (which I already started coding). The ImageServer would then use PIL to convert and zoom the image to the correct size and format and then send the stream. The ImageServer already serves images upon a regular HTTP request. Does anyone of you know a software package I can look at? Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Web2k - Web Design/Development & Technical Project Management