From postmaster at compelcon.se Mon Sep 1 12:19:53 2003 From: postmaster at compelcon.se (MailScanner) Date: Mon Sep 1 05:25:43 2003 Subject: [Image-SIG] Warning: E-mail viruses detected Message-ID: <200309010919.h819Jrwd031339@compelcon.se> Our virus detector has just been triggered by a message you sent:- To: Subject: Re: That movie Date: Mon Sep 1 11:19:53 2003 Any infected parts of the message have not been delivered. This message is simply to warn you that your computer system may have a virus present and should be checked. The virus detector said this about the message: Report: /var/spool/mailscanner/incoming/h819J8A9031238/thank_you.pif Infection: W32/Sobig.F@mm Shortcuts to MS-Dos programs are very dangerous in email (thank_you.pif) -- MailScanner Email Virus Scanner www.mailscanner.info -- This message has been scanned for viruses and dangerous content by MailScanner at Compelcon, and is believed to be clean. From postmaster at linux1.pestalozzi.at Tue Sep 2 16:05:58 2003 From: postmaster at linux1.pestalozzi.at (postmaster@linux1.pestalozzi.at) Date: Tue Sep 2 09:06:05 2003 Subject: [Image-SIG] VIRUS IN YOUR MAIL Message-ID: <200309021305.h82D5wZ12003@linux1.pestalozzi.at> V I R U S A L E R T Our viruschecker found the [Win32/Sobig.F.Worm] virus(es) in your email to the following recipient(s): -> Delivery of the email was stopped! Please check your system for viruses, or ask your system administrator to do so. For your reference, here are the headers from your email: ------------------------- BEGIN HEADERS ----------------------------- From: To: Subject: Re: Re: My details Date: Tue, 2 Sep 2003 15:06:00 +0200 X-MailScanner: Found to be clean Importance: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MSMail-Priority: Normal X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_NextPart_000_00D98EE2" -------------------------- END HEADERS ------------------------------ From ecuevas_ul at iadvantage.net.hk Thu Sep 4 18:52:10 2003 From: ecuevas_ul at iadvantage.net.hk (Erwin Cuevas) Date: Thu Sep 4 13:51:50 2003 Subject: [Image-SIG] can't get it fat? 5sehyu3stf Message-ID: <9f0501c3730d$045c59c5$06580608@6ttve73> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20030904/5fb25f1f/attachment.htm From postmaster at linux1.pestalozzi.at Wed Sep 3 11:13:35 2003 From: postmaster at linux1.pestalozzi.at (postmaster@linux1.pestalozzi.at) Date: Thu Sep 4 23:17:28 2003 Subject: [Image-SIG] VIRUS IN YOUR MAIL Message-ID: <200309030813.h838DZw26654@linux1.pestalozzi.at> V I R U S A L E R T Our viruschecker found the [Win32/Sobig.F.Worm] virus(es) in your email to the following recipient(s): -> Delivery of the email was stopped! Please check your system for viruses, or ask your system administrator to do so. For your reference, here are the headers from your email: ------------------------- BEGIN HEADERS ----------------------------- From: To: Subject: Re: Thank you! Date: Wed, 3 Sep 2003 10:13:37 +0200 X-MailScanner: Found to be clean Importance: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MSMail-Priority: Normal X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_NextPart_000_00081E9D" -------------------------- END HEADERS ------------------------------ From apolit at yahoo.com Sun Sep 7 20:17:40 2003 From: apolit at yahoo.com (Andres Polit) Date: Sun Sep 7 22:17:44 2003 Subject: [Image-SIG] howto?--Converting X pcf fonts to PIL image fonts on Windows Message-ID: <20030908021740.56370.qmail@web12805.mail.yahoo.com> Hello, I'm trying to convert pcf fonts from X11 to image fonts. On linux, I gunzipped helvO18.pcf.gz to get helvO18.pcf. On windows, running python22 I tried: ------ import os, sys from PIL import PcfFontFile f = 'c:\helvO18.pcf' fp = open(f, "rb") p = PcfFontFile.PcfFontFile(fp) ----- PcfFontFile causes an error... 1885562369 1885562369 Traceback (most recent call last): File "", line 1, in ? p = PcfFontFile.PcfFontFile(fp) File "C:\PYTHON22\lib\site-packages\PIL\PcfFontFile.py", line 87, in __init__ encoding = self._load_encoding() File "C:\PYTHON22\lib\site-packages\PIL\PcfFontFile.py", line 250, in _load_encoding encoding[i+firstCol] = encodingOffset IndexError: list assignment index out of range >>> ------ I don't have PIL on Linux. Could anyone tell me how to do this correctly on Windows? Thanks very much. A. Polit __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com From SHUREM at ccf.org Wed Sep 10 13:23:22 2003 From: SHUREM at ccf.org (Mark Shure) Date: Wed Sep 10 12:23:39 2003 Subject: [Image-SIG] Follow-up to Question about ImageDraw.Draw function Message-ID: Hello, Sorry to rehash this thread, but I posted a question about the ImageDraw.Draw function back on August 27th. After some helpful suggestions from Chris Cogdon, Fredrik asked me to post the results from a few diagnostic commands. After I responded, the mailing list seemed to go dead for several days and I never saw any final response to my question. Fredrik, can you tell me if the printout was helpful in diagnosing my problem? Thanks in advance, Mark Shure ------------------------------------------------------------------------------ Confidentiality Note: This message is intended for use only by the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. Thank you. Visit us online at our award-winning www.clevelandclinic.org for a complete listing of Cleveland Clinic services, staff and locations from one of the country's leading hospitals. ============================================================================== From bridgman at wyeth.gsfc.nasa.gov Wed Sep 10 16:06:30 2003 From: bridgman at wyeth.gsfc.nasa.gov (Tom Bridgman) Date: Wed Sep 10 15:06:38 2003 Subject: [Image-SIG] Question on TIFF EXTRASAMPLES tag support Message-ID: <3F5F7636.8C6DD298@wyeth.gsfc.nasa.gov> We're using PIL for converting TIFFs generated by our animations into additional products for web and video release. Today I encountered an incompatible/unsupported TIFF format generated in one of our newer processes. Setting the Image.DEBUG flag, I found that the file had: format key: (2, 1, (8, 8, 8, 8), (1,)) - unsupported format while apparently the nearest supported formats listed in TiffImagePlugin.py are (2, 1, (8,8,8,8), (0,)): ("RGBX", "RGBX"), (2, 1, (8,8,8,8), (2,)): ("RGBA", "RGBA"), Apparently, this file has an incompatible 'EXTRASAMPLES'=1 flag but this appears to be indicating the presence of an alpha channel. After checking some additional references, I'm wondering what's the difference between the EXTRASAMPLES=1 and RGBA? If there is no significant difference, couldn't support for this format be installed by just adding: (2, 1, (8,8,8,8), (1,)): ("RGBA", "RGBA"), to the OPEN_INFO list in TiffImagePlugin.py? Can anyone enlighten me? Should this be installed in the distribution? Other comments/suggestions? I'm no expert on PIL - I'm making this determination based on one afternoon of study... Thanks, Tom -- Dr. William T."Tom" Bridgman Scientific Visualization Studio Global Science & Technology, Inc. NASA/Goddard Space Flight Center Email: bridgman@wyeth.gsfc.nasa.gov Code 935 Phone: 301-286-1346 Greenbelt, MD 20771 FAX: TBD http://svs.gsfc.nasa.gov/ From chris at cogdon.org Wed Sep 10 13:14:00 2003 From: chris at cogdon.org (Chris Cogdon) Date: Wed Sep 10 15:14:05 2003 Subject: [Image-SIG] Question on TIFF EXTRASAMPLES tag support In-Reply-To: <3F5F7636.8C6DD298@wyeth.gsfc.nasa.gov> Message-ID: On Wednesday, Sep 10, 2003, at 12:06 US/Pacific, Tom Bridgman wrote: > We're using PIL for converting TIFFs generated by our animations into > additional products for web and video release. Today I encountered an > incompatible/unsupported TIFF format generated in one of our newer > processes. Setting the Image.DEBUG flag, I found that the file had: > > format key: (2, 1, (8, 8, 8, 8), (1,)) > - unsupported format > > while apparently the nearest supported formats listed in > TiffImagePlugin.py are > > (2, 1, (8,8,8,8), (0,)): ("RGBX", "RGBX"), > (2, 1, (8,8,8,8), (2,)): ("RGBA", "RGBA"), > > Apparently, this file has an incompatible 'EXTRASAMPLES'=1 flag but > this > appears to be indicating the presence of an alpha channel. > > After checking some additional references, I'm wondering what's the > difference between the EXTRASAMPLES=1 and RGBA? If there is no > significant difference, couldn't support for this format be installed > by > just adding: > > (2, 1, (8,8,8,8), (1,)): ("RGBA", "RGBA"), > > to the OPEN_INFO list in TiffImagePlugin.py? > > Can anyone enlighten me? > > Should this be installed in the distribution? > > Other comments/suggestions? I'm no expert on PIL - I'm making this > determination based on one afternoon of study... Try adding that in yourself... does it still work, and work with your image type as expected? :) -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From warmerdam at pobox.com Wed Sep 10 16:16:35 2003 From: warmerdam at pobox.com (Frank Warmerdam) Date: Wed Sep 10 15:16:57 2003 Subject: [Image-SIG] Question on TIFF EXTRASAMPLES tag support In-Reply-To: <3F5F7636.8C6DD298@wyeth.gsfc.nasa.gov> References: <3F5F7636.8C6DD298@wyeth.gsfc.nasa.gov> Message-ID: <3F5F7893.9060207@pobox.com> Tom Bridgman wrote: ... > Apparently, this file has an incompatible 'EXTRASAMPLES'=1 flag but this > appears to be indicating the presence of an alpha channel. > > After checking some additional references, I'm wondering what's the > difference between the EXTRASAMPLES=1 and RGBA? If there is no > significant difference, couldn't support for this format be installed by > just adding: > > (2, 1, (8,8,8,8), (1,)): ("RGBA", "RGBA"), > > to the OPEN_INFO list in TiffImagePlugin.py? > > Can anyone enlighten me? > > Should this be installed in the distribution? > > Other comments/suggestions? I'm no expert on PIL - I'm making this > determination based on one afternoon of study... Tom, extrasamples=1 is defined in the specification as being an associated alpha data with pre-multiplied color components. The text reads: This field must have a value of 1 (associated alpha data with pre-multiplied color components). The associated alpha data stored in component SamplesPerPixel-1 of each pixel contains the opacity of that pixel, and the color information is pre- multiplied by alpha. I gather this means that the RGB color values have already been multiplied with the alpha value before storing in the file though this seems a bit weird to me. The specification is at: ftp://ftp.remotesensing.org/pub/libtiff/TIFF6.pdf Page 77 is what I was looking at. There is lots more discussion. Best regards, -- ---------------------------------------+-------------------------------------- I set the clouds in motion - turn up | Frank Warmerdam, warmerdam@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush | Geospatial Programmer for Rent From bridgman at wyeth.gsfc.nasa.gov Wed Sep 10 16:28:25 2003 From: bridgman at wyeth.gsfc.nasa.gov (Tom Bridgman) Date: Wed Sep 10 15:28:30 2003 Subject: [Image-SIG] Question on TIFF EXTRASAMPLES tag support References: <3F5F7636.8C6DD298@wyeth.gsfc.nasa.gov> <3F5F7893.9060207@pobox.com> Message-ID: <3F5F7B59.1CA7CC4D@wyeth.gsfc.nasa.gov> Frank Warmerdam wrote: > > > extrasamples=1 is defined in the specification as being an associated alpha > data with pre-multiplied color components. The text reads: > > This field must have a value of 1 (associated alpha data with pre-multiplied color > components). The associated alpha data stored in component SamplesPerPixel-1 > of each pixel contains the opacity of that pixel, and the color information is pre- > multiplied by alpha. > > I gather this means that the RGB color values have already been multiplied > with the alpha value before storing in the file though this seems a bit > weird to me. > > The specification is at: > ftp://ftp.remotesensing.org/pub/libtiff/TIFF6.pdf > > Page 77 is what I was looking at. There is lots more discussion. > This makes sense for some types of compositing. Reading this, it looks like the flag is set more as information to any software that reads the file and does additional processing - the image data itself is unaffected. In this case, trying Chris Cogdon's suggestion is probably the best possible suggestion. Thanks, Tom -- Dr. William T."Tom" Bridgman Scientific Visualization Studio Global Science & Technology, Inc. NASA/Goddard Space Flight Center Email: bridgman@wyeth.gsfc.nasa.gov Code 935 Phone: 301-286-1346 Greenbelt, MD 20771 FAX: TBD http://svs.gsfc.nasa.gov/ From bridgman at wyeth.gsfc.nasa.gov Wed Sep 10 17:30:49 2003 From: bridgman at wyeth.gsfc.nasa.gov (Tom Bridgman) Date: Wed Sep 10 16:30:54 2003 Subject: [Image-SIG] Question on TIFF EXTRASAMPLES tag support References: <3F5F7636.8C6DD298@wyeth.gsfc.nasa.gov> Message-ID: <3F5F89F9.C8186318@wyeth.gsfc.nasa.gov> Tom Bridgman wrote: > > significant difference, couldn't support for this format be installed by > just adding: > > (2, 1, (8,8,8,8), (1,)): ("RGBA", "RGBA"), > > to the OPEN_INFO list in TiffImagePlugin.py? I tried this and it *seems* to do what I want. However, is it a bug-fix or a hack? I'd like to not worry about this patch in the next release but it also needs to be done in the proper way. Thoughts? Tom -- Dr. William T."Tom" Bridgman Scientific Visualization Studio Global Science & Technology, Inc. NASA/Goddard Space Flight Center Email: bridgman@wyeth.gsfc.nasa.gov Code 935 Phone: 301-286-1346 Greenbelt, MD 20771 FAX: TBD http://svs.gsfc.nasa.gov/ From jh at web.de Thu Sep 11 00:17:04 2003 From: jh at web.de (Juergen Hermann) Date: Wed Sep 10 17:17:14 2003 Subject: [Image-SIG] Patch for setup.py Message-ID: Hi! The following fixes a problem when setup.py is run by a Python compiled WITHOUT _tkinter support. --- orig/setup.py 2003-05-09 14:00:56.000000000 +0200 +++ Imaging-1.1.4/setup.py 2003-09-08 18:12:43.000000000 +0200 @@ -229,6 +229,8 @@ INCLUDE_DIRS = ["libImaging"] LIBRARY_DIRS = [] LIBRARIES = [] + EXTRA_COMPILE_ARGS = None + EXTRA_LINK_ARGS = None have_freetype = 1 # Assume we have it, unless proven otherwise # use source distribution, if available Ciao, J?rgen From katokop1 at yahoo.com Wed Sep 10 20:15:16 2003 From: katokop1 at yahoo.com (Ragan-Kelley Jonathan) Date: Wed Sep 10 22:15:22 2003 Subject: [Image-SIG] Floating-point (color) TIFF Message-ID: <20030911021516.57712.qmail@web40001.mail.yahoo.com> I am using Python for the first time on a film effects project which is largely built around the color [rgb] floating-point TIFFs output from Pixar's RenderMan renderer. I was excited at all of the built-in functionality of Python, especially when paired with a few additional support libraries like PIL, but my first attempts to load the images with PIL yielded failure. PIL claims support for floating-point TIFFs, but it seems to only include single-channel files, not RGB or RGBA in FP32. I have some old C code specifically built to load these relatively uncommon TIFFs, but it seems that PIL *should* support them, with at most a minimum of work. Does anyone here have any experience with these files, in particular, or any pointers on how to most quickly and painlessly add support for them? ${python}/lib/site-packages/PIL/TiffImagePlugin.py seems to implement all of the basic TIFF IO functionality, but it isn't obvious -- superficially at least -- where I might quickly add support for RGB[A]/FP32. Any other recommendations? I'm not particularly wedded to PIL, as I'm primarily using it for image loading. Bringing out my old code and wrapping it with SWIG is an easy option, but it would always be nice to use existing, commonly-installed infrastructure rather than unnecessarily requiring custom libraries. Thanks. -jrk __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com From perry.tew at cibavision.novartis.com Tue Sep 2 08:16:33 2003 From: perry.tew at cibavision.novartis.com (perry.tew@cibavision.novartis.com) Date: Thu Sep 11 08:24:55 2003 Subject: [Image-SIG] [PIL installation] missing ANSI C headers on Solaris => my solution and suggestions Message-ID: Hello all, I'm new to python and spent some time Friday installing PIL using the following configuration: OS: SunOS usatux29 5.8 Generic_108528-13 sun4u sparc SUNW,Sun-Fire-280R python: packaged with Zope (python 2.1.3) At any rate, I ran into several issues with the install. After being unable to find resolutions addressed in a mailing list anywhere I decided to post this in hopes of helping others down the line. At the end of this email I list the correct steps for installing PIL on a solaris box. Note, in the examples below you'll see Imaging-1.1.2. That was my playground. The same applies to Imaging-1.1.4 ========================================================================= BOTTOM LINE Most of my problems were because I did not have the directory containing libjpeg in my LD_LIBRARY_PATH environment variable. ========================================================================= Symptons I received as a result, when I ran configure: [tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging >./configure creating cache ./config.cache checking for --without-gcc... no checking for gcc... gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... yes checking whether gcc accepts -g... yes checking for ranlib... ranlib checking for ar... ar checking MACHDEP... sunos5 checking for jpeg_destroy_compress in -ljpeg... yes checking for deflate in -lz... yes checking how to run the C preprocessor... gcc -E checking for ANSI C header files... no checking for inline... inline checking whether byte ordering is bigendian... yes checking size of char... 0 checking size of short... 0 checking size of int... 0 checking size of long... 0 checking size of float... 0 checking size of double... 0 checking for working const... yes checking for prototypes... yes checking for unistd.h... yes checking for getpagesize... yes checking for working mmap... no updating cache ./config.cache creating ./config.status creating Makefile creating ImConfig.h Then, when running make, I received the following errors: [tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging >make gcc -O -I./. -I/usr/local/include -DHAVE_CONFIG_H -c coretest.c In file included from Imaging.h:21, from coretest.c:19: ImPlatform.h:18: #error Sorry, this library requires ANSI header files. ImPlatform.h:36: #error Cannot find required 32-bit integer type ImPlatform.h:48: #error Cannot find required 32-bit floating point type *** Error code 1 make: Fatal error: Command failed for target `coretest.o' The confusing parts about the configure process were these lines of output: checking for ANSI C header files... no ... checking size of char... 0 checking size of short... 0 checking size of int... 0 checking size of long... 0 checking size of float... 0 checking size of double... 0 I looked in my config.log and found the C code used by configure to test these parts of my system. The reason all of these tests were failing was that configure was passing -ljpeg as a gcc compiler option. Since I did not have libjpeg in my ld path, the compilation failed and I received the errors above. ========================================================================= SOLUTIONS Once I did the added the directory containing libjpeg to my ld path, configure produced different output and make worked as desired: # where is my libjpeg?? [tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging >find / -name "libjpeg*" /opt/sfw/lib/libjpeg.so /opt/sfw/lib/libjpeg.so.1 /opt/sfw/lib/libjpeg.so.6 ... additional places, like java's directory, etc [tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging >export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/sfw/lib [tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging >make distclean [tewpe1@usatux29] /opt/cmf/PIL/Imaging-1.1.2/libImaging >./configure creating cache ./config.cache checking for --without-gcc... no checking for gcc... gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... yes checking whether gcc accepts -g... yes checking for ranlib... ranlib checking for ar... ar checking MACHDEP... sunos5 checking for jpeg_destroy_compress in -ljpeg... yes checking for deflate in -lz... yes checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for inline... inline checking whether byte ordering is bigendian... yes checking size of char... 1 checking size of short... 2 checking size of int... 4 checking size of long... 4 checking size of float... 4 checking size of double... 8 checking for working const... yes checking for prototypes... yes checking for unistd.h... yes checking for getpagesize... yes checking for working mmap... yes updating cache ./config.cache creating ./config.status creating Makefile creating ImConfig.h Looks much better now! I would assume that the location of libjpeg will vary on systems, but the find command will point anyone to the correct location. ========================================================================= SUMMARY OF STEPS FOR INSTALLING PIL ON SOLARIS: gtar zxvf Imaging-1.1.2.tar.gz cd Imaging-1.1.2/libImaging export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/the/directory/containing/libjpeg ./configure edit Makefile and add -fPIC to the end of the CFLAGS variable ( about line 36? ) make make check cd .. make -f Makefile.pre.in boot edit Setup.in and added -L/opt/sfw/lib to the libjpeg specification, also commented out the tk stuff since I'm not using it make make install ========================================================================= SUGGESTIONS: First, to the authors of PIL, thanks for the software. I am grateful for the use of it. I hope that these suggestions will be perceived as such and not complaining. 1. The README gives the appearance that the jpeg library is optional, when it's not since configure doesn't produce the correct output without libjpeg in the ld path. """ If you need JPEG and/or PNG support, make sure to get and build the necessary external libraries: - for JPEG support, get the IJG JPEG library, version 6a or 6b. You can find this library here: http://www.ijg.org ftp://ftp.uu.net/graphics/jpeg/ """ Should this be changed to remove the If? 2. The configure process should run a test specifically for libjpeg and fail with an error message stating that it could not be loaded and is needed by the program. If this were done at the beginning of the build process, I believe it would be enough information for an admin or developer to make the adjustments necessary to install PIL. 3. Is there a way to remove the jpeg and z library dependencies for the ASNI C header check and the sizeof checks? I don't know the GNU Autoconf toolset very well, but I think a check for sizeof should only fail if the sizeof C call fails, and not for a missing library that isn't used in the actual C code. 4. I didn't have xv on my system, so I received a non-fatal error while running 'make check'. It would be useful if it were documented in the README or elsewhere that a successful make check depended on xv. Well, I hope this information is found useful by others. If I haven't got something quite right, please let me know. Thanks, Perry Tew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/image-sig/attachments/20030902/ad07969e/attachment-0001.htm From bridgman at wyeth.gsfc.nasa.gov Thu Sep 11 11:05:59 2003 From: bridgman at wyeth.gsfc.nasa.gov (Tom Bridgman) Date: Thu Sep 11 10:06:12 2003 Subject: [Image-SIG] Floating-point (color) TIFF References: <20030911021516.57712.qmail@web40001.mail.yahoo.com> Message-ID: <3F608147.E0AAF9C3@wyeth.gsfc.nasa.gov> We also would have some interest in this format as well. >From my explorations into TiffImagePlugin.py yesterday, I'm wondering whether the structure is sufficiently modular that just defining some MODE might 'just work'. There is also a _MODEINFO entry in Image.py that seems to do fundamental definitions of things like RGB, RGBA, etc. For example, for 3,4-channel FP TIFFs, would a _MODEINFO entry of "RGB;F32":("RGB","F",("R","G","B")) "RGBA;F32:("RGBA","F",("R","G","B","A")) (Perhaps others for handling different endian issues?) and appropriate entries in OPEN_INFO and SAVE_INFO in TiffImagePlugin.py just call the appropriate modules already in PIL? Comments are sorely lacking in some parts of this code so I'm not clear on the precise calling sequence or overall structure. "Writing your own file decoder" in the handbook is some help for a general decoder, but doesn't enlighten too much on the tiff-specific code. I don't currently have a floating-point TIFF to test this on. Just some thinking-out-loud. Caveat Emptor. Tom Ragan-Kelley Jonathan wrote: > > I am using Python for the first time on a film effects > project which is largely built around the color [rgb] > floating-point TIFFs output from Pixar's RenderMan > renderer. I was excited at all of the built-in > functionality of Python, especially when paired with a > few additional support libraries like PIL, but my > first attempts to load the images with PIL yielded > failure. > > PIL claims support for floating-point TIFFs, but it > seems to only include single-channel files, not RGB or > RGBA in FP32. > > I have some old C code specifically built to load > these relatively uncommon TIFFs, but it seems that PIL > *should* support them, with at most a minimum of work. > Does anyone here have any experience with these > files, in particular, or any pointers on how to most > quickly and painlessly add support for them? > ${python}/lib/site-packages/PIL/TiffImagePlugin.py > seems to implement all of the basic TIFF IO > functionality, but it isn't obvious -- superficially > at least -- where I might quickly add support for > RGB[A]/FP32. > > Any other recommendations? I'm not particularly > wedded to PIL, as I'm primarily using it for image > loading. Bringing out my old code and wrapping it > with SWIG is an easy option, but it would always be > nice to use existing, commonly-installed > infrastructure rather than unnecessarily requiring > custom libraries. > > Thanks. > -jrk > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com > > _______________________________________________ > Image-SIG maillist - Image-SIG@python.org > http://mail.python.org/mailman/listinfo/image-sig -- Dr. William T."Tom" Bridgman Scientific Visualization Studio Global Science & Technology, Inc. NASA/Goddard Space Flight Center Email: bridgman@wyeth.gsfc.nasa.gov Code 935 Phone: 301-286-1346 Greenbelt, MD 20771 FAX: TBD http://svs.gsfc.nasa.gov/ From fanny at intellisoft.ro Sat Sep 13 08:14:49 2003 From: fanny at intellisoft.ro (Cotloana Stefan) Date: Sat Sep 13 08:14:58 2003 Subject: [Image-SIG] build Image fromstring Message-ID: <5.2.1.1.0.20030913151151.00ad76e8@62.231.118.129> Hello I want to build an Image using the function fromstring and an binary string that contains a JPEG image. Please give me an example. Thank You. Cu respect, Stefan From thorsten.harms at arche.de Mon Sep 15 09:38:34 2003 From: thorsten.harms at arche.de (Thorsten harms) Date: Mon Sep 15 09:37:53 2003 Subject: [Image-SIG] Draw text right-aligned with ImageDraw Message-ID: Hi! I have a little problem customizing one of our programs. It draws text with ImageDraw.text(). But now I need to draw the text right-aligned. Any hints or suggestions? Thanks in advance Thorsten Harms From martinxyz at gmx.ch Mon Sep 15 10:18:49 2003 From: martinxyz at gmx.ch (Martin Renold) Date: Mon Sep 15 10:18:57 2003 Subject: [Image-SIG] Draw text right-aligned with ImageDraw In-Reply-To: References: Message-ID: <20030915141849.GA6202@old.homeip.net> On Mon, Sep 15, 2003 at 02:38:34PM +0100, Thorsten harms wrote: > with ImageDraw.text(). But now I need to draw the text right-aligned. Yes, ImageDraw.Draw.textsize. text(self, xy, text, fill=None, font=None, anchor=None) ^ planned? bye, Martin From dsamersoff at assist.ru Wed Sep 17 03:50:49 2003 From: dsamersoff at assist.ru (Dmitry Samersoff) Date: Wed Sep 17 03:51:14 2003 Subject: [Image-SIG] KOI8-r PIL fonts Message-ID: <3F681259.5060202@assist.ru> Where I can get KOI8-r fonts in PIL format ? Could someone send me one? Thanks! -- Dmitry Samersoff Technical director, http://www.assist.ru dsamersoff@assist.ru, Tel: +7(812)4381000 * There will come soft rains ... From gherman at darwin.in-berlin.de Wed Sep 17 06:31:41 2003 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed Sep 17 06:31:36 2003 Subject: [Image-SIG] Does PIL not handle TIFFs created on Mac OS X? Message-ID: <207B10B7-E8FA-11D7-A462-00039345C610@darwin.in-berlin.de> Hi, has anybody succeeded here in using PIL for loading TIFFs generated on OS X, e.g. stuff like the attached little sample file? I'm using PIL 1.1.4, but get errors like the following: >>> import Image >>> tiff = Image.open("test.tiff") Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.2/site-packages/PIL/Image.py", line 1571, in open raise IOError("cannot identify image file") IOError: cannot identify image file Thanks, Dinu -------------- next part -------------- A non-text attachment was scrubbed... Name: test.tiff Type: image/tiff Size: 9654 bytes Desc: not available Url : http://mail.python.org/pipermail/image-sig/attachments/20030917/33e8d2ca/test.tiff -------------- next part -------------- -- Dinu C. Gherman ...................................................................... "The whole point of brainwashing, is that those being brainwashed don't know it." (Graham Haley) From uc at dfki.de Wed Sep 17 08:15:31 2003 From: uc at dfki.de (Ulrich Callmeier) Date: Wed Sep 17 08:16:18 2003 Subject: [Image-SIG] [bug report] loading PNG with PIL 1.1.4 under python 2.3 Message-ID: <000f01c37d15$66afd350$d8bb6086@weep> Hi, when loading a certain PNG file with PIL 1.1.4 under python 2.3 (Linux), I get an error as soon as the library tries to load the image. This also happens when I trigger the load() explicitely. I suspect it might be due to the fact that it's an interlaced PNG file. Does anyone have an idea on how to fix this? The problematic image file is at http://www.dfki.de/~crysmann/bc.png. Here's a log of what happens: Python 2.3 (#1, Aug 20 2003, 15:16:14) [GCC 3.2.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import Image >>> print Image.VERSION 1.1.4 >>> im = Image.open("bc.png") >>> im.load() Traceback (most recent call last): File "", line 1, in ? File "/project/cl/deepthought/local/lib/python2.3/site-packages/PIL/ImageFile .py", line 192, in load raise IOError(error + " when reading image file") IOError: unknown error when reading image file >>> print im.info {'interlace': 1, 'gamma': 0.45455000000000001} >>> print im.mode P >>> print im.format PNG Thanks for any hints, Ulrich From bridgman at wyeth.gsfc.nasa.gov Wed Sep 17 08:19:03 2003 From: bridgman at wyeth.gsfc.nasa.gov (Tom Bridgman) Date: Wed Sep 17 08:19:06 2003 Subject: [Image-SIG] Does PIL not handle TIFFs created on Mac OS X? References: <207B10B7-E8FA-11D7-A462-00039345C610@darwin.in-berlin.de> Message-ID: <3F685137.8F9ED47D@wyeth.gsfc.nasa.gov> Hi, My installation reads this file under OS X, but I have a slight patch which I describe in my post last week for handling TIFFs with Extrasamples=1. > > significant difference, couldn't support for this format be installed by > > just adding: > > > > (2, 1, (8,8,8,8), (1,)): ("RGBA", "RGBA"), > > > > to the OPEN_INFO list in TiffImagePlugin.py? Perhaps you need to update SAVE_INFO as well. I'm not sure if this is the RIGHT way to do it, but it seems to read the file okay. Was this generated by RenderMan? Tom Dinu Gherman wrote: > > Hi, > > has anybody succeeded here in using PIL for loading TIFFs generated > on OS X, e.g. stuff like the attached little sample file? I'm using > PIL 1.1.4, but get errors like the following: > > >>> import Image > >>> tiff = Image.open("test.tiff") > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.2/site-packages/PIL/Image.py", line 1571, in > open > raise IOError("cannot identify image file") > IOError: cannot identify image file > > Thanks, > > Dinu > > ------------------------------------------------------------------------ > Name: test.tiff > test.tiff Type: TIFF Image (image/tiff) > Encoding: base64 > > Part 1.3 Type: Plain Text (text/plain) > Encoding: 7bit > > Part 1.4 Type: Plain Text (text/plain) > Encoding: 7bit -- Dr. William T."Tom" Bridgman Scientific Visualization Studio Global Science & Technology, Inc. NASA/Goddard Space Flight Center Email: bridgman@wyeth.gsfc.nasa.gov Code 935 Phone: 301-286-1346 Greenbelt, MD 20771 FAX: TBD http://svs.gsfc.nasa.gov/ From gherman at darwin.in-berlin.de Wed Sep 17 08:48:39 2003 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed Sep 17 08:48:33 2003 Subject: [Image-SIG] Does PIL not handle TIFFs created on Mac OS X? In-Reply-To: <3F685137.8F9ED47D@wyeth.gsfc.nasa.gov> Message-ID: <42C1C1AE-E90D-11D7-94AE-00039345C610@darwin.in-berlin.de> Tom Bridgman: > Was this generated by RenderMan? Ermm, I can't afford RenderMan (unless it's free by now)... No, it was created by pdf2tiff.py ;-) http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223320 Regards, Dinu -- Dinu C. Gherman ...................................................................... "The pure and simple truth is rarely pure and never simple." (Oscar Wilde) From uc at dfki.de Wed Sep 17 10:09:14 2003 From: uc at dfki.de (Ulrich Callmeier) Date: Wed Sep 17 10:10:16 2003 Subject: [Image-SIG] [bug report] loading PNG with PIL 1.1.4 under python 2.3 Message-ID: <000001c37d25$534700d0$d8bb6086@weep> Hi again, OK, sorry for this, it turns out this is a documented feature. Interlaced PNG files are not supported by PIL. Cheers, Ulrich From managan at llnl.gov Wed Sep 17 12:32:08 2003 From: managan at llnl.gov (Rob Managan) Date: Wed Sep 17 12:32:35 2003 Subject: [Image-SIG] Does PIL not handle TIFFs created on Mac OS X? In-Reply-To: <207B10B7-E8FA-11D7-A462-00039345C610@darwin.in-berlin.de> References: <207B10B7-E8FA-11D7-A462-00039345C610@darwin.in-berlin.de> Message-ID: At 12:31 PM +0200 9/17/03, Dinu Gherman wrote: >Hi, > >has anybody succeeded here in using PIL for loading TIFFs generated >on OS X, e.g. stuff like the attached little sample file? I'm using >PIL 1.1.4, but get errors like the following: > > >>> import Image > >>> tiff = Image.open("test.tiff") > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.2/site-packages/PIL/Image.py", line 1571, in open > raise IOError("cannot identify image file") > IOError: cannot identify image file > If you add the line Image.DEBUG = 1 after the import you get this information tag: ImageWidth (256) - type: short (3) - value: (55,) tag: ImageLength (257) - type: short (3) - value: (43,) tag: BitsPerSample (258) - type: short (3) - value: (8, 8, 8, 8) tag: Compression (259) - type: short (3) - value: (1,) tag: PhotometricInterpretation (262) - type: short (3) - value: (2,) tag: StripOffsets (273) - type: long (4) - value: (8,) tag: SamplesPerPixel (277) - type: short (3) - value: (4,) tag: StripByteCounts (279) - type: long (4) - value: (9460,) tag: XResolution (282) - type: rational (5) - value: ((720000, 10000),) tag: YResolution (283) - type: rational (5) - value: ((720000, 10000),) tag: PlanarConfiguration (284) - type: short (3) - value: (1,) tag: ResolutionUnit (296) - type: short (3) - value: (2,) tag: ExtraSamples (338) - type: short (3) - value: (1,) *** Summary *** - compression: raw - photometric_interpretation: 2 - planar_configuration: 1 - size: (55, 43) format key: (2, 1, (8, 8, 8, 8), (1,)) - unsupported format tag: ImageWidth (256) - type: short (3) - value: (55,) tag: ImageLength (257) - type: short (3) - value: (43,) tag: BitsPerSample (258) - type: short (3) - value: (8, 8, 8, 8) tag: Compression (259) - type: short (3) - value: (1,) tag: PhotometricInterpretation (262) - type: short (3) - value: (2,) tag: StripOffsets (273) - type: long (4) - value: (8,) tag: SamplesPerPixel (277) - type: short (3) - value: (4,) tag: StripByteCounts (279) - type: long (4) - value: (9460,) tag: XResolution (282) - type: rational (5) - value: ((720000, 10000),) tag: YResolution (283) - type: rational (5) - value: ((720000, 10000),) tag: PlanarConfiguration (284) - type: short (3) - value: (1,) tag: ResolutionUnit (296) - type: short (3) - value: (2,) tag: ExtraSamples (338) - type: short (3) - value: (1,) *** Summary *** - compression: raw - photometric_interpretation: 2 - planar_configuration: 1 - size: (55, 43) format key: (2, 1, (8, 8, 8, 8), (1,)) - unsupported format In the IDE I found that the problem originates in PIL/TiffImagePlugin.py line 510 The closest format keys are (2, 1, (8, 8, 8, 8), (0,)) ('RGBX','(RGBX)') (2, 1, (8, 8, 8, 8), (2,)) ('RGBA','(RGBA)') I tired adding (2, 1, (8, 8, 8, 8), (1,)) ('RGBX','(RGBX)') but I haven't succeeded in getting the change to be used yet. Must be doing it in the wrong place. -- *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- Rob Managan email managan at llnl.gov LLNL phone: 925-423-0903 P.O. Box 808, L-095 FAX: 925-422-3389 Livermore, CA 94551-0808 From bridgman at wyeth.gsfc.nasa.gov Wed Sep 17 14:09:50 2003 From: bridgman at wyeth.gsfc.nasa.gov (Tom Bridgman) Date: Wed Sep 17 14:09:55 2003 Subject: [Image-SIG] Does PIL not handle TIFFs created on Mac OS X? References: <207B10B7-E8FA-11D7-A462-00039345C610@darwin.in-berlin.de> Message-ID: <3F68A36E.499E9C8D@wyeth.gsfc.nasa.gov> Rob Managan wrote: > > At 12:31 PM +0200 9/17/03, Dinu Gherman wrote: > >Hi, > > > >has anybody succeeded here in using PIL for loading TIFFs generated > >on OS X, e.g. stuff like the attached little sample file? I'm using > >PIL 1.1.4, but get errors like the following: > > > > >>> import Image > > >>> tiff = Image.open("test.tiff") > > Traceback (most recent call last): > > File "", line 1, in ? > > File "/usr/lib/python2.2/site-packages/PIL/Image.py", line 1571, in open > > raise IOError("cannot identify image file") > > IOError: cannot identify image file > > > If you add the line > Image.DEBUG = 1 after the import you get this information > tag: ImageWidth (256) - type: short (3) - value: (55,) > tag: ImageLength (257) - type: short (3) - value: (43,) > tag: BitsPerSample (258) - type: short (3) - value: (8, 8, 8, 8) > tag: Compression (259) - type: short (3) - value: (1,) > tag: PhotometricInterpretation (262) - type: short (3) - value: (2,) > tag: StripOffsets (273) - type: long (4) - value: (8,) > tag: SamplesPerPixel (277) - type: short (3) - value: (4,) > tag: StripByteCounts (279) - type: long (4) - value: (9460,) > tag: XResolution (282) - type: rational (5) - value: ((720000, 10000),) > tag: YResolution (283) - type: rational (5) - value: ((720000, 10000),) > tag: PlanarConfiguration (284) - type: short (3) - value: (1,) > tag: ResolutionUnit (296) - type: short (3) - value: (2,) > tag: ExtraSamples (338) - type: short (3) - value: (1,) > *** Summary *** > - compression: raw > - photometric_interpretation: 2 > - planar_configuration: 1 > - size: (55, 43) > format key: (2, 1, (8, 8, 8, 8), (1,)) > - unsupported format > tag: ImageWidth (256) - type: short (3) - value: (55,) > tag: ImageLength (257) - type: short (3) - value: (43,) > tag: BitsPerSample (258) - type: short (3) - value: (8, 8, 8, 8) > tag: Compression (259) - type: short (3) - value: (1,) > tag: PhotometricInterpretation (262) - type: short (3) - value: (2,) > tag: StripOffsets (273) - type: long (4) - value: (8,) > tag: SamplesPerPixel (277) - type: short (3) - value: (4,) > tag: StripByteCounts (279) - type: long (4) - value: (9460,) > tag: XResolution (282) - type: rational (5) - value: ((720000, 10000),) > tag: YResolution (283) - type: rational (5) - value: ((720000, 10000),) > tag: PlanarConfiguration (284) - type: short (3) - value: (1,) > tag: ResolutionUnit (296) - type: short (3) - value: (2,) > tag: ExtraSamples (338) - type: short (3) - value: (1,) > *** Summary *** > - compression: raw > - photometric_interpretation: 2 > - planar_configuration: 1 > - size: (55, 43) > format key: (2, 1, (8, 8, 8, 8), (1,)) > - unsupported format > > In the IDE I found that the problem originates in > PIL/TiffImagePlugin.py line 510 > > The closest format keys are > (2, 1, (8, 8, 8, 8), (0,)) ('RGBX','(RGBX)') > (2, 1, (8, 8, 8, 8), (2,)) ('RGBA','(RGBA)') > > I tired adding (2, 1, (8, 8, 8, 8), (1,)) ('RGBX','(RGBX)') > but I haven't succeeded in getting the change to be used yet. Must be > doing it in the wrong place. > -- Try "RGBA" instead of "RBGX" since the extra is an alpha-channel. That worked per my earlier comments. Tom -- Dr. William T."Tom" Bridgman Scientific Visualization Studio Global Science & Technology, Inc. NASA/Goddard Space Flight Center Email: bridgman@wyeth.gsfc.nasa.gov Code 935 Phone: 301-286-1346 Greenbelt, MD 20771 FAX: TBD http://svs.gsfc.nasa.gov/ From s_t_a_n_i at yahoo.com Wed Sep 17 22:19:11 2003 From: s_t_a_n_i at yahoo.com (www.stani.be) Date: Wed Sep 17 22:19:15 2003 Subject: [Image-SIG] Quicktime port to Windows, join the project! Message-ID: <20030918021911.90247.qmail@web21102.mail.yahoo.com> Hi, We are forming a team to port the Quicktime API to Windows. People involved till now are: Jack Jansen (who did the qt port on Mac Os X, probably more as advisor), Bruce Williams (C++) and me (Python). As we can't know how much work it'll be, it would be nice if some more people join. Any help is welcome (C++, Python, website, documenting,...) The quicktime api is quite low level, so I think we might need some more Python programmers to make also a more high-level library. Objectives are: 1 Exporting from Quicktime movie the frames to a Pil and PythonMagick format. 2 The opposite, saving it back to a movie 3 the rest of the quicktime api 4 maybe a wxPython movie control, ... So, please folks, join!!! Stani http://spe.pycs.net http://www.stani.be __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com From s_t_a_n_i at yahoo.com Wed Sep 17 22:21:41 2003 From: s_t_a_n_i at yahoo.com (www.stani.be) Date: Wed Sep 17 22:21:45 2003 Subject: [Image-SIG] PIL and PythonMagick Message-ID: <20030918022141.916.qmail@web21101.mail.yahoo.com> Does anyone has a script to convert one format to another, probably with tostring? Stani __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com From borja.prieto at wanadoo.es Thu Sep 18 17:18:24 2003 From: borja.prieto at wanadoo.es (Borja Prieto) Date: Thu Sep 18 17:18:29 2003 Subject: [Image-SIG] [Zope] PIL and TIFF problem Message-ID: I have installed Easy Image and PIL 1.1.4 on my Zope 2.6.1 with Python 2.1.3 on Windows XP. It works well with jpg and other formats, but when I try to upload a TIFF image (wich is precisely what I want) it gives me the error: IOError "decoder tiff_ccitt not available" I have followed the guide on Zope.org (http://www.zope.org/Members/SmileyChris/howto/pil_for_windows) to install PIL, and I have no idea what can I be doing wrong. I will appreciate any help you could give. Borja Prieto Alanta From chris at cogdon.org Thu Sep 18 17:58:23 2003 From: chris at cogdon.org (Chris Cogdon) Date: Thu Sep 18 17:58:28 2003 Subject: [Image-SIG] [Zope] PIL and TIFF problem In-Reply-To: Message-ID: <396230A6-EA23-11D7-A2DF-000A95E3823E@cogdon.org> On Thursday, Sep 18, 2003, at 14:18 US/Pacific, Borja Prieto wrote: > I have installed Easy Image and PIL 1.1.4 on my Zope 2.6.1 with Python > 2.1.3 > on Windows XP. > It works well with jpg and other formats, but when I try to upload a > TIFF > image (wich is precisely what I want) it gives me the error: > > IOError "decoder tiff_ccitt not available" > > I have followed the guide on Zope.org > (http://www.zope.org/Members/SmileyChris/howto/pil_for_windows) to > install > PIL, and I have no idea what can I be doing wrong. I will appreciate > any > help you could give. PIL doesn't support ccitt (group 3 or 4) decompression. Although it should not be that hard to write your own decoder and attach it into the PIL system. Group 3 (at least) encoding is fairly simple... I've done it previously with non-PIL applications. -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From yu.wang at gsf.de Fri Sep 19 12:12:17 2003 From: yu.wang at gsf.de (WANG Yu) Date: Fri Sep 19 12:12:32 2003 Subject: [Image-SIG] imagedraw Message-ID: <3F6B2AE1.6090602@gsf.de> Hello, I tried to run the example from the documentation of Imagedraw, but got the following errors: moco ~/python>imagetest.py (370, 278) Traceback (most recent call last): File "imagetest.py", line 12, in ? draw.line((0, 0), im.size) File "/home/users/wang/JUNK/Python-2.3/lib/python2.3/site-packages/PIL/ImageDraw.py", line 183, in line ink, fill = self._getink(fill) File "/home/users/wang/JUNK/Python-2.3/lib/python2.3/site-packages/PIL/ImageDraw.py", line 131, in _getink ink = self.draw.draw_ink(ink, self.mode) TypeError: an integer is required The code looks like this: #! /Python-2.3/bin/python2.3 import Image, ImageDraw im = Image.open("/junk/image570735x.jpg") # draw a grey cross over the image draw = ImageDraw.ImageDraw(im) draw.setink(128) draw.line((0, 0), im.size) draw.line((0, im.size[1]), (im.size[0], 0)) del draw im.show() Can anybody tell me what went wrong? Thank you very much in advance. Yu -- Ir. Yu Wang Institute for Bioinformatics GSF - German Research Center for Environment and Health Ingolstaedter Landstr. 1 D-85764 Neuherberg, GERMANY _______________________________________________________ http://mips.gsf.de Email:yu.wang@gsf.de Tel: (+49) 89/3187-2627 Fax: (+49) 89/3187-3585 _______________________________________________________ "What Fools These Mortals Be," W. Shakespeare From chris at cogdon.org Fri Sep 19 12:32:23 2003 From: chris at cogdon.org (Chris Cogdon) Date: Fri Sep 19 12:32:30 2003 Subject: [Image-SIG] imagedraw In-Reply-To: <3F6B2AE1.6090602@gsf.de> Message-ID: On Friday, Sep 19, 2003, at 09:12 US/Pacific, WANG Yu wrote: > draw.line((0, 0), im.size) This needs to be like this: draw.line ( ((0,0),im.size) ) There is a SINGLE line parameter, which can be ((x1,y1),(x2,y2) or (x1,y1,x2,y2). If you don't put in that extra set of parenthesis, then you're passing im.size to the 'ink' parameter, which requires a integer. -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From dustin.hofstetter at gmx.ch Mon Sep 22 05:29:53 2003 From: dustin.hofstetter at gmx.ch (Dustin Hofstetter) Date: Mon Sep 22 05:30:18 2003 Subject: [Image-SIG] Getting Pixel Colors from a Canvas Message-ID: Hi I'm trying to find a way to get pixel colors back from a canvas with MacPython (MacOS 9), and got lost in de enormous variety of modules. Is ist possible that there is such a variety of functions and methods but nothing like "getpixel(x,y)"? Thanks for help DUSTIN From wmcclain at salamander.com Mon Sep 22 11:04:45 2003 From: wmcclain at salamander.com (Bill McClain) Date: Mon Sep 22 11:01:34 2003 Subject: [Image-SIG] Getting Pixel Colors from a Canvas In-Reply-To: References: Message-ID: <20030922100445.28e32c32.wmcclain@salamander.com> On Mon, 22 Sep 2003 11:29:53 +0200 Dustin Hofstetter wrote: > Is ist possible that there is such a variety of functions and methods > but nothing like "getpixel(x,y)"? Perhaps I misunderatand your question. getpixel() is in the Image module, clearly shown in the documentation. -Bill -- Sattre Press The King in Yellow http://sattre-press.com/ by Robert W. Chambers info@sattre-press.com http://kiy.sattre-press.com/ From bob at redivi.com Mon Sep 22 14:46:01 2003 From: bob at redivi.com (Bob Ippolito) Date: Mon Sep 22 14:46:02 2003 Subject: [Image-SIG] Quicktime port to Windows, join the project! Message-ID: <031BFB3A-ED2D-11D7-B0B9-000A95686CD8@redivi.com> > We are forming a team to port the Quicktime API to > Windows. People involved till now are: Jack Jansen > (who did the qt port on Mac Os X, probably more as > advisor), Bruce Williams (C++) and me (Python). As we > can't know how much work it'll be, it would be nice if > some more people join. Any help is welcome (C++, > Python, website, documenting,...) The quicktime api is > quite low level, so I think we might need some more > Python programmers to make also a more high-level > library. Objectives are: Jack Jansen's bgen will probably wrap the Windows QuickTime just as well as it did for the Mac. "just as well" being key here. There are some rather large issues with regard to the current state of the Python support for QuickTime on the Mac, primarily due to situations where Jack just chose not to wrap part of the API, or where a NULL argument is sometimes necessary but the wrapper won't let it through. I've hacked around some of this, but one of a few things need to happen: 1) do it without bgen 2) find all the missing/special cases and add those to the bgen support file Personally I prefer to do this sort of wrapping with Pyrex because it's really easy since you don't have to write any of the Python C API code. I'd bet that a modified-to-spit-out-pyrex version of bgen would be quite powerful, but one might want something lower level than bgen's regexes to parse the original header files. ctypes is also a good way to wrap things, because it's so easy to fix if you need to, but I've had problems with callbacks (at least on OS X). The advantage to ctypes would be no compilation, and the wrapper would be nearly identical on Mac and Win32. > 1 > Exporting from Quicktime movie the frames to a Pil and > PythonMagick format. > > 2 > The opposite, saving it back to a movie Why not just go with Numeric or numarray and let PIL/PythonMagick/etc take it from there? That's what I do. You pretty much have to use Numeric to translate images (slow! numeric doesn't have a vectorized permute) because PIL doesn't like ARGB. > 3 > the rest of the quicktime api A lot of this probably isn't necessary, because people just aren't using it. The bgen wrappers have been broken for a lot of cases for years because nobody has tried it, fixed it, and contributed the fixes. I don't even know if it's possible to create a quicktime movie from scratch with an unfixed wrapper. It would be nice if it only advertised the stuff it *did* do, but someone would need to write a whole test suite for the sucker. > 4 > maybe a wxPython movie control, ... Why not just use the ActiveX API for playing quicktime movies? It'd be a lot easier to do. wxWindows can probably already embed ActiveX controls. -bob From Jack.Jansen at cwi.nl Mon Sep 22 15:44:11 2003 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon Sep 22 15:44:16 2003 Subject: [Image-SIG] Quicktime port to Windows, join the project! In-Reply-To: <031BFB3A-ED2D-11D7-B0B9-000A95686CD8@redivi.com> References: <031BFB3A-ED2D-11D7-B0B9-000A95686CD8@redivi.com> Message-ID: <2370C039-ED35-11D7-ADB6-000A27B19B96@cwi.nl> On 22-sep-03, at 20:46, Bob Ippolito wrote: > Jack Jansen's bgen will probably wrap the Windows QuickTime just as > well as it did for the Mac. "just as well" being key here. There are > some rather large issues with regard to the current state of the > Python support for QuickTime on the Mac, primarily due to situations > where Jack just chose not to wrap part of the API, or where a NULL > argument is sometimes necessary but the wrapper won't let it through. > I've hacked around some of this, but one of a few things need to > happen: > 1) do it without bgen > 2) find all the missing/special cases and add those to the bgen > support file There's actually a much easier solution: allow for the various objects to wrap NULL pointers. In other words, add a couple of object Qt.NULLMovie and such that are movie-objects but wrapping a null pointer. It's on my todo list, but at the moment I have absolutely no time for Python work (as people have undoubtedly noticed). And the bit of information that Bob probably missed is that I've had the MacPython Quicktime module working on windows at some point in the past. So it is really a question of cleanup and polishing. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From bob at redivi.com Mon Sep 22 16:03:55 2003 From: bob at redivi.com (Bob Ippolito) Date: Mon Sep 22 16:03:52 2003 Subject: [Image-SIG] Quicktime port to Windows, join the project! In-Reply-To: <2370C039-ED35-11D7-ADB6-000A27B19B96@cwi.nl> Message-ID: On Monday, Sep 22, 2003, at 15:44 America/New_York, Jack Jansen wrote: > > On 22-sep-03, at 20:46, Bob Ippolito wrote: >> Jack Jansen's bgen will probably wrap the Windows QuickTime just as >> well as it did for the Mac. "just as well" being key here. There >> are some rather large issues with regard to the current state of the >> Python support for QuickTime on the Mac, primarily due to situations >> where Jack just chose not to wrap part of the API, or where a NULL >> argument is sometimes necessary but the wrapper won't let it through. >> I've hacked around some of this, but one of a few things need to >> happen: >> 1) do it without bgen >> 2) find all the missing/special cases and add those to the bgen >> support file > > There's actually a much easier solution: allow for the various objects > to wrap NULL pointers. In other words, add a couple of object > Qt.NULLMovie and such that are movie-objects but wrapping a null > pointer. > > It's on my todo list, but at the moment I have absolutely no time for > Python work (as people have undoubtedly noticed). > > And the bit of information that Bob probably missed is that I've had > the MacPython Quicktime module working on windows at some point in the > past. So it is really a question of cleanup and polishing. I'll try and take care of it, then. I'm already relatively familiar with bgen, the QuickTime API and its bgen wrapper. I have a modified copy here that builds outside of the Python source tree with distutils and uses the OS X style Apple headers (not Universal headers).. it's also capable of making movies from scratch with compression (this is why I modified the wrapper). The next question is (and I'll copy this to pythonmac), how would this get phased in? It's not possible to replace a system module using site-packages (without jacking sys.path), so in order to do a Package Manager upgrade we would need to force admin privileges or just use a different name. The renaming route is probably optimal, since a Carbon tree isn't going to make sense in win32, so what should I name it? Should it be a package or a py/extension pair? I also have full access to Windows and Visual Studio.NET, so a win32 port shouldn't be a problem (other than motivation). Do you have your todo list public anywhere? I might be able to help knock some of them out. -bob From Jack.Jansen at cwi.nl Mon Sep 22 18:15:05 2003 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon Sep 22 18:15:09 2003 Subject: [Pythonmac-SIG] Re: [Image-SIG] Quicktime port to Windows, join the project! In-Reply-To: References: Message-ID: <3859A7D4-ED4A-11D7-ADB6-000A27B19B96@cwi.nl> On 22-sep-03, at 22:03, Bob Ippolito wrote: > On Monday, Sep 22, 2003, at 15:44 America/New_York, Jack Jansen wrote: > >> >> On 22-sep-03, at 20:46, Bob Ippolito wrote: >>> Jack Jansen's bgen will probably wrap the Windows QuickTime just as >>> well as it did for the Mac. "just as well" being key here. There >>> are some rather large issues with regard to the current state of the >>> Python support for QuickTime on the Mac, primarily due to situations >>> where Jack just chose not to wrap part of the API, or where a NULL >>> argument is sometimes necessary but the wrapper won't let it >>> through. I've hacked around some of this, but one of a few things >>> need to happen: >>> 1) do it without bgen >>> 2) find all the missing/special cases and add those to the bgen >>> support file >> >> There's actually a much easier solution: allow for the various >> objects to wrap NULL pointers. In other words, add a couple of object >> Qt.NULLMovie and such that are movie-objects but wrapping a null >> pointer. >> >> It's on my todo list, but at the moment I have absolutely no time for >> Python work (as people have undoubtedly noticed). >> >> And the bit of information that Bob probably missed is that I've had >> the MacPython Quicktime module working on windows at some point in >> the past. So it is really a question of cleanup and polishing. > > I'll try and take care of it, then. I'm already relatively familiar > with bgen, the QuickTime API and its bgen wrapper. I have a modified > copy here that builds outside of the Python source tree with distutils > and uses the OS X style Apple headers (not Universal headers).. it's > also capable of making movies from scratch with compression (this is > why I modified the wrapper). Ok, great! The mods to bgen (which I assume is what allows you to use the OSX-style headers, right?) I would like to see as a patch. The QT mods: read on. > > The next question is (and I'll copy this to pythonmac), how would this > get phased in? It's not possible to replace a system module using > site-packages (without jacking sys.path), so in order to do a Package > Manager upgrade we would need to force admin privileges or just use a > different name. The renaming route is probably optimal, since a > Carbon tree isn't going to make sense in win32, so what should I name > it? Should it be a package or a py/extension pair? Well, for this one case there's a simple solution: QuickTime shouldn't be in Carbon in the first place. So, we start by creating a QuickTime package (if we keep the current two-level structure it'll have QuickTime.QuickTime for the constants and QuickTime.Qt for the actual objects and functions) and an underlying C module that needs a new name, _QuickTime_Qt or something. This is distutils-installable, and will be included in 2.4 (with Carbon.Qt and Carbon.QuickTime importing them, after issuing a DeprecationWarning). > I also have full access to Windows and Visual Studio.NET, so a win32 > port shouldn't be a problem (other than motivation). Help would be appreciated:-) > Do you have your todo list public anywhere? I might be able to help > knock some of them out. One of the topmost points is "Catching up with all the stuff Bob Ippolito did and integrating it":-) -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From bbaxter at wadsworth.org Tue Sep 23 14:14:41 2003 From: bbaxter at wadsworth.org (William Baxter) Date: Tue Sep 23 14:16:31 2003 Subject: [Image-SIG] combining enhancers Message-ID: <3F708D91.C10256E6@wadsworth.org> Is there a way to combine the output of enhancers in PIL? I'd like 2 sliders for brightness and contrast to be used for the same image. But if I try to use ImageEnhance.Brightness and ImageEnhance.Contrast on the same image, they keep resetting, as if it's 2 separate images. Thanks, Bill B. From chris at cogdon.org Tue Sep 23 14:33:00 2003 From: chris at cogdon.org (Chris Cogdon) Date: Tue Sep 23 14:33:05 2003 Subject: [Image-SIG] combining enhancers In-Reply-To: <3F708D91.C10256E6@wadsworth.org> Message-ID: <5C0A4BCA-EDF4-11D7-9A81-000A95E3823E@cogdon.org> On Tuesday, Sep 23, 2003, at 11:14 US/Pacific, William Baxter wrote: > Is there a way to combine the output of enhancers in PIL? I'd like 2 > sliders for brightness and contrast to be used for the same image. But > if I try to use ImageEnhance.Brightness and ImageEnhance.Contrast on > the > same image, they keep resetting, as if it's 2 separate images. Note that the output of 'enhance' is a new image; it doesn't affect the current image So you'd need to do this: # your image is in 'im' enh = ImageEnhance.Contrast ( im ) im = enh.enhance ( 1 ) enh = ImageEnhance.Brightness ( im ) im = enh.enhance ( 1 ) Yes, I think this is a little daft. It would have made a LOT more sense to be able to pass the image to be enhanced into the 'enhance' method, but it appears that some of the filters that are set up need the source image as some kind of 'reference'. See the ImageEnhance.py source for examples (eg: Sharpness) If you don't like it, you could always wrap those two statements in it's own function :) -- ("`-/")_.-'"``-._ Chris Cogdon . . `; -._ )-;-,_`) (v_,)' _ )`-.\ ``-' _.- _..-_/ / ((.' ((,.-' ((,/ fL From bob at redivi.com Tue Sep 23 15:21:35 2003 From: bob at redivi.com (Bob Ippolito) Date: Tue Sep 23 15:24:11 2003 Subject: [Image-SIG] combining enhancers In-Reply-To: <5C0A4BCA-EDF4-11D7-9A81-000A95E3823E@cogdon.org> Message-ID: <257A5FD8-EDFB-11D7-A788-000A95686CD8@redivi.com> On Tuesday, Sep 23, 2003, at 14:33 America/New_York, Chris Cogdon wrote: > > On Tuesday, Sep 23, 2003, at 11:14 US/Pacific, William Baxter wrote: > >> Is there a way to combine the output of enhancers in PIL? I'd like 2 >> sliders for brightness and contrast to be used for the same image. But >> if I try to use ImageEnhance.Brightness and ImageEnhance.Contrast on >> the >> same image, they keep resetting, as if it's 2 separate images. > > Note that the output of 'enhance' is a new image; it doesn't affect > the current image So you'd need to do this: > > # your image is in 'im' > > enh = ImageEnhance.Contrast ( im ) > im = enh.enhance ( 1 ) > > enh = ImageEnhance.Brightness ( im ) > im = enh.enhance ( 1 ) > > > Yes, I think this is a little daft. It would have made a LOT more > sense to be able to pass the image to be enhanced into the 'enhance' > method, but it appears that some of the filters that are set up need > the source image as some kind of 'reference'. See the ImageEnhance.py > source for examples (eg: Sharpness) > > If you don't like it, you could always wrap those two statements in > it's own function :) I would do something like this (in Python 2.2 or later, of course): def filterChain(image, *filters) yield image for filter, parameter in filters: image = filter(image).enhance(parameter) yield image # the 1's here would be your slider values for newImage in filterChain(oldImage, (ImageEnhance.Contrast, 1), (ImageEnhance.Brightness, 1)): pass newImage is now the fully filtered image, but you can peek at each step of the filter during the for loop if you wanted to show progress or something. -bob From angelpeream at yahoo.com Thu Sep 25 10:32:19 2003 From: angelpeream at yahoo.com (=?iso-8859-1?q?Angel=20Perea=20Martinez?=) Date: Thu Sep 25 10:32:22 2003 Subject: [Image-SIG] rendering symbol font with pil 1.4 Message-ID: <20030925143219.49042.qmail@web40711.mail.yahoo.com> Hi, I?m relatively new to PIL, so perhaps I`m overseeing something trivial, but when I use the font Symbol with truetype (in the truetype mode, i see only squares. I have no problem with other types, as arial etc. f = ImageFont.truetype(n,fSize) self.draw.text ((x,y), text.encode("Latin-1"), font = f) __________________________________________________________________ Gesendet von Yahoo! Mail - http://mail.yahoo.de Logos und Klingelt?ne f?rs Handy bei http://sms.yahoo.de From kevin at cazabon.com Thu Sep 25 17:14:35 2003 From: kevin at cazabon.com (kevin@cazabon.com) Date: Thu Sep 25 18:11:27 2003 Subject: [Image-SIG] PIL and Windows printing... Message-ID: <029d01c383aa$0617ae00$2c0aa8c0@duallie> Does anyone have a complete example of a function to print a PIL image to a Windows printer? I've found a few snippets through Google, but nothing that's really helped tremendously so far. I've been trying to play with win32print, and haven't yet been successful. Thanks, Kevin. From fredrik at pythonware.com Fri Sep 26 10:00:15 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri Sep 26 10:00:24 2003 Subject: [Image-SIG] Re: Question on TIFF EXTRASAMPLES tag support References: <3F5F7636.8C6DD298@wyeth.gsfc.nasa.gov><3F5F7893.9060207@pobox.com> <3F5F7B59.1CA7CC4D@wyeth.gsfc.nasa.gov> Message-ID: Tom Bridgman wrote: > > I gather this means that the RGB color values have already been multiplied > > with the alpha value before storing in the file though this seems a bit > > weird to me. > > > > The specification is at: > > ftp://ftp.remotesensing.org/pub/libtiff/TIFF6.pdf > > > > Page 77 is what I was looking at. There is lots more discussion. > > > > This makes sense for some types of compositing. > > Reading this, it looks like the flag is set more as information to any > software that reads the file and does additional processing - the image > data itself is unaffected. no, the RGB data has been premultiplied with the alpha value; to get the original RGB value, you have to divide each of red, green, and blue with the corresponding alpha value. (see page 31 in the TIFF spec for some more info) your patch is correct only if "A in (0, 255)" is true for the entire image. (I'll see if I can do something about this in 1.1.5). cheers /F From fredrik at pythonware.com Fri Sep 26 16:26:43 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri Sep 26 16:31:53 2003 Subject: [Image-SIG] Re: Follow-up to Question about ImageDraw.Draw function References: Message-ID: Mark Shure wrote: > Sorry to rehash this thread, but I posted a question > about the ImageDraw.Draw function back on August > 27th. After some helpful suggestions from Chris Cogdon, > Fredrik asked me to post the results from a few > diagnostic commands. After I responded, the mailing > list seemed to go dead for several days and I never > saw any final response to my question. I've found one local machine that had a Python install with exactly the same problem, but I don't know what installation kits we used when we installed Python on that machine. I haven't been able to repeat the problem using currently available install kits. Have you tried uninstalling and reinstalling PIL? From fredrik at pythonware.com Sat Sep 27 08:24:47 2003 From: fredrik at pythonware.com (Fredrik Lundh) Date: Sat Sep 27 08:25:00 2003 Subject: [Image-SIG] Re: rendering symbol font with pil 1.4 References: <20030925143219.49042.qmail@web40711.mail.yahoo.com> Message-ID: Angel Perea Martinez wrote: > Hi, I´m relatively new to PIL, so perhaps I`m > overseeing something trivial, but when I use the font > Symbol with truetype (in the truetype mode, i see only > squares. I have no problem with other types, as arial > etc. > > f = ImageFont.truetype(n,fSize) > self.draw.text ((x,y), text.encode("Latin-1"), font = f) PIL's current freetype driver only supports fonts that use the Unicode character set; Microsoft's Symbol font uses a proprietary encoding. as a quick workaround, change the "getfont" method in _imagingft.c so that the last few lines look like this: if (error) { PyObject_DEL(self); PyErr_SetString(PyExc_IOError, "cannot load font"); return NULL; } /* --- start of patch --- */ /* explicitly select Unicode or Symbol charmap */ if (FT_Select_Charmap(self->face, ft_encoding_unicode)) FT_Select_Charmap(self->face, ft_encoding_symbol); /* --- end of patch --- */ return (PyObject*) self; also, the symbol characters lie in the 0xF000-0xF0FF character range; to draw e.g. symbol 68 (whatever that is), pass in unichr(0xf000+68) to the "text" method. From ondrap at penguin.cz Sun Sep 28 17:50:39 2003 From: ondrap at penguin.cz (Ondrej Palkovsky) Date: Sun Sep 28 17:50:50 2003 Subject: [Image-SIG] Jpeg EXIF patch Message-ID: I am not sure where should I send patches, but I have not found any other address than this. I have written a small patch to JpegImagePlugin that facilitates easier extraction of Exif tags from Jpeg files. It automatically maps the number constants to strings according to ExifTags and extracts the thumbnail properties & image from the exif header. It does not read the Interoperability nor the Marker IFD. The patch is available at http://www.penguin.cz/~ondrap/patch.jpeg.txt . I did test it on python 2.3, but should work on the whole 2.x branch. It will not probably work with 1.5 because as far as I remember the {}.get method is not supported, but this could be easily changed. Ondrej From gary at commsecure.com.au Sun Sep 28 20:53:41 2003 From: gary at commsecure.com.au (Gary Capell) Date: Sun Sep 28 20:53:46 2003 Subject: [Image-SIG] setup.py for Imaging-1.1.4, no _tkinter, has freetype -> crash Message-ID: <20030929105341.B16410@commsecure.com.au> Hi, The setup.py for Imaging-1.1.4 breaks if there is no _tkinter module but there is freetype2. The EXTRA_COMPILE_ARGS and EXTRA_LINK_ARGS variables are set in the _tkinter section, and assumed to still be there in the freetype section. I just added null values for these, but probably something more clever needs to be done. wsgary:/tmp# diff -c Imaging-1.1.4.orig/setup.py Imaging-1.1.4/setup.py *** Imaging-1.1.4.orig/setup.py 2003-05-09 22:00:56.000000000 +1000 --- Imaging-1.1.4/setup.py 2003-09-29 10:44:38.000000000 +1000 *************** *** 229,234 **** --- 229,236 ---- INCLUDE_DIRS = ["libImaging"] LIBRARY_DIRS = [] LIBRARIES = [] + EXTRA_COMPILE_ARGS=None + EXTRA_LINK_ARGS=None have_freetype = 1 # Assume we have it, unless proven otherwise # use source distribution, if available -- Gary Capell