From matt at west.co.tt Mon Jan 2 03:23:50 2012 From: matt at west.co.tt (Matt Westcott) Date: Mon, 2 Jan 2012 02:23:50 +0000 Subject: [Image-SIG] Patch - read support for Adobe Filmstrip (.flm) files Message-ID: <9213D2E7-ABF5-4691-9A82-0EAF90002E39@west.co.tt> Hi, I recently found myself needing to process some Adobe Filmstrip (.flm) files with PIL. This format was apparently introduced with Adobe Premiere, and is described here: http://www.compuphase.com/filmstrp.htm It's a remarkably simple format (consisting of a sequence of uncompressed RGBA images along with a fixed 36-byte header at the end), and so I've put together a straightforward file decoder plugin to provide read-only support for the format - I hope this will be useful to others. You can find a sample .flm file here (zipped), for testing: http://zxdemo.org/extra/Matthew.flm.zip The 'open' method sets the following info properties: frame_count - number of images in the sequence fps - frame rate specified by the file, in frames per second The 'seek' and 'tell' methods are implemented for moving between frames - random access is supported. Kind regards, - Matt Westcott -------------- next part -------------- A non-text attachment was scrubbed... Name: FlmImagePlugin.py Type: text/x-python-script Size: 2152 bytes Desc: not available URL: From edward at unicornschool.org Thu Jan 5 20:21:35 2012 From: edward at unicornschool.org (Edward Cannon) Date: Thu, 5 Jan 2012 11:21:35 -0800 Subject: [Image-SIG] Simple Question, avoid Image.save In-Reply-To: <20111229123106.01A4B6F443@smtp.hushmail.com> References: <20111229123106.01A4B6F443@smtp.hushmail.com> Message-ID: you want to use Image.save with a file object rather than a file. This allows you to keep the data in memory without creating a file. There are several options for file objects, depending on what you might want to do afterwards. On Thu, Dec 29, 2011 at 4:31 AM, wrote: > Hi, I wanted to get the actual bmp data without writting the content to > disk. > > Example: > im = Image.new("RGB", (16, 16) ) > im.save('image.bmp') > > I want to avoid im.save, and just get the actual BMP file data for further > processing. > > Hope you can help me. > > Thanks a lot! > Sean > > _______________________________________________ > Image-SIG maillist ?- ?Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > From matt at west.co.tt Thu Jan 5 20:22:28 2012 From: matt at west.co.tt (Matt Westcott) Date: Thu, 5 Jan 2012 19:22:28 +0000 Subject: [Image-SIG] Simple Question, avoid Image.save In-Reply-To: <20111229123106.01A4B6F443@smtp.hushmail.com> References: <20111229123106.01A4B6F443@smtp.hushmail.com> Message-ID: <9011C567-F26B-4D23-A50B-5EA85620E660@west.co.tt> On 29 Dec 2011, at 12:31, auto11436877 at hushmail.com wrote: > Hi, I wanted to get the actual bmp data without writting the content to disk. > > Example: > im = Image.new("RGB", (16, 16) ) > im.save('image.bmp') > > I want to avoid im.save, and just get the actual BMP file data for further processing. > > Hope you can help me. Hi, The im.save method can accept a file object instead of a filename, which means you can avoid writing to disk by passing it a StringIO object instead: import StringIO, Image im = Image.new("RGB", (16, 16) ) io = StringIO.StringIO() im.save(io, 'bmp') bmpdata = io.getvalue() - Matt From halbert at halwitz.org Thu Jan 5 19:18:51 2012 From: halbert at halwitz.org (Dan Halbert) Date: Thu, 5 Jan 2012 13:18:51 -0500 (EST) Subject: [Image-SIG] Simple Question, avoid Image.save In-Reply-To: <20111229123106.01A4B6F443@smtp.hushmail.com> References: <20111229123106.01A4B6F443@smtp.hushmail.com> Message-ID: <1325787531.97530123@beta.apps.rackspace.com> On Thursday, December 29, 2011 7:31am, auto11436877 at hushmail.com said: Hi, I wanted to get the actual bmp data without writting the content to disk. Example: im = Image.new("RGB", (16, 16) ) im.save('image.bmp') I want to avoid im.save, and just get the actual BMP file data for further processing. Do you mean you want to get at the pixels? See Image.getdata() and putdata(), Image.getpixel() and putpixel(), and Image.load() (fastest way), all of which provide pixel-level access in varying ways. Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew at west.co.tt Thu Jan 5 20:21:21 2012 From: matthew at west.co.tt (Matthew Westcott) Date: Thu, 5 Jan 2012 19:21:21 +0000 Subject: [Image-SIG] Simple Question, avoid Image.save In-Reply-To: <20111229123106.01A4B6F443@smtp.hushmail.com> References: <20111229123106.01A4B6F443@smtp.hushmail.com> Message-ID: On 29 Dec 2011, at 12:31, auto11436877 at hushmail.com wrote: > Hi, I wanted to get the actual bmp data without writting the content to disk. > > Example: > im = Image.new("RGB", (16, 16) ) > im.save('image.bmp') > > I want to avoid im.save, and just get the actual BMP file data for further processing. > > Hope you can help me. Hi, The im.save method can accept a file object instead of a filename, which means you can avoid writing to disk by passing it a StringIO object instead: import StringIO, Image im = Image.new("RGB", (16, 16) ) io = StringIO.StringIO() im.save(io, 'bmp') bmpdata = io.getvalue() - Matt From efotinis at gmail.com Fri Jan 6 07:48:00 2012 From: efotinis at gmail.com (Elias Fotinis) Date: Fri, 06 Jan 2012 08:48:00 +0200 Subject: [Image-SIG] Simple Question, avoid Image.save In-Reply-To: <20111229123106.01A4B6F443@smtp.hushmail.com> References: <20111229123106.01A4B6F443@smtp.hushmail.com> Message-ID: On Thu, 29 Dec 2011 14:31:05 +0200, wrote: > Hi, I wanted to get the actual bmp data without writting the content > to disk. > Example:im = Image.new("RGB", (16, 16) )im.save('image.bmp') > I want to avoid im.save, and just get the actual BMP file data for > further processing. Use im.tostring() to get the data as a string, or im.getdata() to get a sequence of (R,G,B) tuples. From steve at strassmann.com Sat Jan 14 04:19:28 2012 From: steve at strassmann.com (Steve Strassmann) Date: Fri, 13 Jan 2012 22:19:28 -0500 Subject: [Image-SIG] =?windows-1252?q?_error=3A_conflicting_types_for_=91I?= =?windows-1252?q?magingJpegDecode=92_while_installing_PIL_on_Mac_OS?= Message-ID: <0CB56B39-3D78-480C-BE4F-79D8DF705879@strassmann.com> Hi, I'm trying to install Imaging 1.1.7 on Mac OS 10.6.8 with python 2.6. I've already installed jpeg-6b, which seems to be ok ('make check' seems to run without errors). I have tried both 'python setup.py install' and pip install http://effbot.org/downloads/Imaging-1.1.7.tar.gz and I get the same error (snip 1 below) either way. Does anyone know how I can get past this? When I run ./BUILDME (see snip 2 below), setup seems to claim that "JPEG support available" but selftest seems to claim "JPEG support not installed". That seems odd to me. thanks, Steve --- snip 1 --- gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch x86_64 -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.6/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c libImaging/JpegDecode.c -o build/temp.macosx-10.6-universal-2.6/libImaging/JpegDecode.o libImaging/JpegDecode.c:119: error: conflicting types for ?ImagingJpegDecode? libImaging/Imaging.h:416: error: previous declaration of ?ImagingJpegDecode? was here libImaging/JpegDecode.c: In function ?ImagingJpegDecode?: libImaging/JpegDecode.c:145: warning: assignment from incompatible pointer type libImaging/JpegDecode.c:151: error: invalid operands to binary - (have ?const JOCTET *? and ?UINT8 *?) libImaging/JpegDecode.c:237: warning: passing argument 1 of ?state->shuffle? from incompatible pointer type libImaging/JpegDecode.c:262: error: invalid operands to binary - (have ?const JOCTET *? and ?UINT8 *?) error: command 'gcc-4.2' failed with exit status 1 --- snip 2 --- -------------------------------------------------------------------- PIL 1.1.7 SETUP SUMMARY -------------------------------------------------------------------- version 1.1.7 platform darwin 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) [GCC 4.2.1 (Apple Inc. build 5646)] -------------------------------------------------------------------- --- TKINTER support available --- JPEG support available --- ZLIB (PNG/ZIP) support available *** FREETYPE2 support not available *** LITTLECMS support not available -------------------------------------------------------------------- To add a missing option, make sure you have the required library, and set the corresponding ROOT variable in the setup.py script. To check the build, run the selftest.py script. -------------------------------------------------------------------- PIL 1.1.7 TEST SUMMARY -------------------------------------------------------------------- Python modules loaded from ./PIL Binary modules loaded from ./PIL -------------------------------------------------------------------- --- PIL CORE support ok --- TKINTER support ok *** JPEG support not installed --- ZLIB (PNG/ZIP) support ok *** FREETYPE2 support not installed *** LITTLECMS support not installed -------------------------------------------------------------------- From dale at blackbagtech.com Mon Jan 16 18:04:06 2012 From: dale at blackbagtech.com (Dale Cieslak) Date: Mon, 16 Jan 2012 09:04:06 -0800 Subject: [Image-SIG] =?windows-1252?q?error=3A_conflicting_types_for_=91Im?= =?windows-1252?q?agingJpegDecode=92_while_installing_PIL_on_Mac_OS?= In-Reply-To: <0CB56B39-3D78-480C-BE4F-79D8DF705879@strassmann.com> References: <0CB56B39-3D78-480C-BE4F-79D8DF705879@strassmann.com> Message-ID: Have you tried installing with MacPorts? I've always had good luck installing packages with it (including PIL). http://www.macports.org ~Dale On Jan 13, 2012, at 7:19 PM, Steve Strassmann wrote: > Hi, I'm trying to install Imaging 1.1.7 on Mac OS 10.6.8 with python 2.6. > I've already installed jpeg-6b, which seems to be ok ('make check' seems to run without errors). > > I have tried both 'python setup.py install' and > pip install http://effbot.org/downloads/Imaging-1.1.7.tar.gz > and I get the same error (snip 1 below) either way. Does anyone know how I can get past this? > > When I run ./BUILDME (see snip 2 below), setup seems to claim that "JPEG support available" > but selftest seems to claim "JPEG support not installed". That seems odd to me. > > thanks, > Steve > > --- snip 1 --- > gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch x86_64 -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.6/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c libImaging/JpegDecode.c -o build/temp.macosx-10.6-universal-2.6/libImaging/JpegDecode.o > > libImaging/JpegDecode.c:119: error: conflicting types for ?ImagingJpegDecode? > libImaging/Imaging.h:416: error: previous declaration of ?ImagingJpegDecode? was here > libImaging/JpegDecode.c: In function ?ImagingJpegDecode?: > libImaging/JpegDecode.c:145: warning: assignment from incompatible pointer type > libImaging/JpegDecode.c:151: error: invalid operands to binary - (have ?const JOCTET *? and ?UINT8 *?) > libImaging/JpegDecode.c:237: warning: passing argument 1 of ?state->shuffle? from incompatible pointer type > libImaging/JpegDecode.c:262: error: invalid operands to binary - (have ?const JOCTET *? and ?UINT8 *?) > error: command 'gcc-4.2' failed with exit status 1 > > --- snip 2 --- > > -------------------------------------------------------------------- > PIL 1.1.7 SETUP SUMMARY > -------------------------------------------------------------------- > version 1.1.7 > platform darwin 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) > [GCC 4.2.1 (Apple Inc. build 5646)] > -------------------------------------------------------------------- > --- TKINTER support available > --- JPEG support available > --- ZLIB (PNG/ZIP) support available > *** FREETYPE2 support not available > *** LITTLECMS support not available > -------------------------------------------------------------------- > To add a missing option, make sure you have the required > library, and set the corresponding ROOT variable in the > setup.py script. > > To check the build, run the selftest.py script. > -------------------------------------------------------------------- > PIL 1.1.7 TEST SUMMARY > -------------------------------------------------------------------- > Python modules loaded from ./PIL > Binary modules loaded from ./PIL > -------------------------------------------------------------------- > --- PIL CORE support ok > --- TKINTER support ok > *** JPEG support not installed > --- ZLIB (PNG/ZIP) support ok > *** FREETYPE2 support not installed > *** LITTLECMS support not installed > -------------------------------------------------------------------- > > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3739 bytes Desc: not available URL: From steve at strassmann.com Tue Jan 17 05:02:38 2012 From: steve at strassmann.com (Steve Strassmann) Date: Mon, 16 Jan 2012 23:02:38 -0500 Subject: [Image-SIG] =?windows-1252?q?error=3A_conflicting_types_for_=91Im?= =?windows-1252?q?agingJpegDecode=92_while_installing_PIL_on_Mac_OS?= In-Reply-To: References: <0CB56B39-3D78-480C-BE4F-79D8DF705879@strassmann.com> Message-ID: <455718F6-8614-45CA-B7A7-264C95C3A095@strassmann.com> Thanks, Dale, using macports worked for me! On Jan 16, 2012, at 12:04 PM, Dale Cieslak wrote: > Have you tried installing with MacPorts? I've always had good luck installing packages with it (including PIL). > > http://www.macports.org > > ~Dale From steve at strassmann.com Tue Jan 17 06:38:26 2012 From: steve at strassmann.com (Steve Strassmann) Date: Tue, 17 Jan 2012 00:38:26 -0500 Subject: [Image-SIG] =?windows-1252?q?error=3A_conflicting_types_for_=91Im?= =?windows-1252?q?agingJpegDecode=92_while_installing_PIL_on_Mac_OS?= In-Reply-To: References: <0CB56B39-3D78-480C-BE4F-79D8DF705879@strassmann.com> Message-ID: Well, I might have been a bit too quick to celebrate. It's true that MacPorts installs PIL successfully on Mac OS. I can run my (simple newbie) app running the MacPort Python 2.7 that gets created. The problem is that my Tk windows are now all X11-styled, which is very unfriendly to Mac users. Using macports: $ /opt/local/bin/python2.7 >>> from Tkinter import Tk >>> Tk().tk.call('tk', 'windowingsystem') 'x11' Using the native Mac python environment gives me nice spiffy Mac-native windows, but no Imaging: $ /usr/bin/python >>> from Tkinter import Tk >>> Tk().tk.call('tk', 'windowingsystem') 'aqua' I tried simply copying the macports site-packages/PIL over to my native site-packages, but running that crashes Tk. How can I get a working python environment with Imaging that lets me create Tk apps with the mac aqua GUI enabled? thanks From bryce2 at obviously.com Thu Jan 19 22:39:12 2012 From: bryce2 at obviously.com (Bryce2 Nesbitt) Date: Thu, 19 Jan 2012 13:39:12 -0800 Subject: [Image-SIG] JPEG libraries on python virtual environments Message-ID: I recently struggled to get PIL to recognize JPG images from within a Python virtual environment. I'm writing to the list to document what I eventually found: pip uninstall PIL sudo apt-get install libjpeg8-dev pip install PIL http://stackoverflow.com/questions/4435016/install-pil-on-virtualenv-with-libjpeg PIL seems really picky about version and location of the jpeg libraries. And because PIL is written in C and compiled, you need the development versions of the library in addition to the runtime versions. Turns: -------------------------------------------------------------------- *** TKINTER support not available --- JPEG support not available --- ZLIB (PNG/ZIP) support available --- FREETYPE2 support available *** LITTLECMS support not available -------------------------------------------------------------------- Into: -------------------------------------------------------------------- *** TKINTER support not available --- JPEG support available --- ZLIB (PNG/ZIP) support available --- FREETYPE2 support available *** LITTLECMS support not available -------------------------------------------------------------------- From charlie.clark at clark-consulting.eu Thu Jan 19 22:42:27 2012 From: charlie.clark at clark-consulting.eu (Charlie Clark) Date: Thu, 19 Jan 2012 22:42:27 +0100 Subject: [Image-SIG] JPEG libraries on python virtual environments In-Reply-To: References: Message-ID: Am 19.01.2012, 22:39 Uhr, schrieb Bryce2 Nesbitt : > pip uninstall PIL > sudo apt-get install libjpeg8-dev > pip install PIL Try pip install pillow. Pillow is a fork of PIL that is easier to use with setuptools. Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Kronenstr. 27a D?sseldorf D- 40217 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 From marcin.tustin at gmail.com Mon Jan 23 18:56:02 2012 From: marcin.tustin at gmail.com (Marcin Tustin) Date: Mon, 23 Jan 2012 17:56:02 +0000 Subject: [Image-SIG] PIL install scripts broken? Message-ID: Hi, I just tried to install PIL on windows 7 under python 2.7.2, using both easy_install and pip, and neither of them will install. Instead, the error messages suggest that there is a problem with the install scripts. Does anyone have suggestions for workarounds? Is anyone maintaining the PIL distributions? Transcript of attempts to install follows: (oneclickcos) C:\Users\Marcin\Documents\oneclickcos\oneclickcos\oneclickcos>pip install PIL Downloading/unpacking PIL ? Running setup.py egg_info for package PIL ? ? WARNING: '' not a valid package name; please use only.-separated package names in setup.py Installing collected packages: PIL ? Running setup.py install for PIL ? ? WARNING: '' not a valid package name; please use only.-separated package names in setup.py ? ? building '_imaging' extension ? ? error: Unable to find vcvarsall.bat ? ? Complete output from command C:\Users\Marcin\Documents\oneclickcos\Scripts\python.exe -c "import setuptools;__file__='C:\\Users\\Marcin\\Documents\\oneclick cos\\build\\PIL\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record c: \users\marcin\appdata\local\temp\pip-dqjnaq-record\install-record.txt --install-headers C:\Users\Marcin\Documents\oneclickcos\include\site\python2.7: ? ? WARNING: '' not a valid package name; please use only.-separated package names in setup.py running install running build running build_py copying PIL\ArgImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\BdfFontFile.py -> build\lib.win-amd64-2.7 copying PIL\BmpImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\ContainerIO.py -> build\lib.win-amd64-2.7 copying PIL\CurImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\DcxImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\EpsImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\ExifTags.py -> build\lib.win-amd64-2.7 copying PIL\FitsStubImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\FliImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\FontFile.py -> build\lib.win-amd64-2.7 copying PIL\FpxImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\GbrImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\GdImageFile.py -> build\lib.win-amd64-2.7 copying PIL\GifImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\GimpGradientFile.py -> build\lib.win-amd64-2.7 copying PIL\GimpPaletteFile.py -> build\lib.win-amd64-2.7 copying PIL\GribStubImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\IcnsImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\IcoImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\Image.py -> build\lib.win-amd64-2.7 copying PIL\ImageChops.py -> build\lib.win-amd64-2.7 copying PIL\ImageCms.py -> build\lib.win-amd64-2.7 copying PIL\ImageColor.py -> build\lib.win-amd64-2.7 copying PIL\ImageDraw.py -> build\lib.win-amd64-2.7 copying PIL\ImageDraw2.py -> build\lib.win-amd64-2.7 copying PIL\ImageEnhance.py -> build\lib.win-amd64-2.7 copying PIL\ImageFile.py -> build\lib.win-amd64-2.7 copying PIL\ImageFileIO.py -> build\lib.win-amd64-2.7 copying PIL\ImageFilter.py -> build\lib.win-amd64-2.7 copying PIL\ImageFont.py -> build\lib.win-amd64-2.7 copying PIL\ImageGL.py -> build\lib.win-amd64-2.7 copying PIL\ImageGrab.py -> build\lib.win-amd64-2.7 copying PIL\ImageMath.py -> build\lib.win-amd64-2.7 copying PIL\ImageMode.py -> build\lib.win-amd64-2.7 copying PIL\ImageOps.py -> build\lib.win-amd64-2.7 copying PIL\ImagePalette.py -> build\lib.win-amd64-2.7 copying PIL\ImagePath.py -> build\lib.win-amd64-2.7 copying PIL\ImageQt.py -> build\lib.win-amd64-2.7 copying PIL\ImageSequence.py -> build\lib.win-amd64-2.7 copying PIL\ImageShow.py -> build\lib.win-amd64-2.7 copying PIL\ImageStat.py -> build\lib.win-amd64-2.7 copying PIL\ImageTk.py -> build\lib.win-amd64-2.7 copying PIL\ImageTransform.py -> build\lib.win-amd64-2.7 copying PIL\ImageWin.py -> build\lib.win-amd64-2.7 copying PIL\ImImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\ImtImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\IptcImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\JpegImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\McIdasImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\MicImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\MpegImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\MspImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\OleFileIO.py -> build\lib.win-amd64-2.7 copying PIL\PaletteFile.py -> build\lib.win-amd64-2.7 copying PIL\PalmImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PcdImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PcfFontFile.py -> build\lib.win-amd64-2.7 copying PIL\PcxImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PdfImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PixarImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PngImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PpmImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PsdImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\PSDraw.py -> build\lib.win-amd64-2.7 copying PIL\SgiImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\SpiderImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\SunImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\TarIO.py -> build\lib.win-amd64-2.7 copying PIL\TgaImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\TiffImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\TiffTags.py -> build\lib.win-amd64-2.7 copying PIL\WalImageFile.py -> build\lib.win-amd64-2.7 copying PIL\WmfImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\XbmImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\XpmImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-2.7 copying PIL\__init__.py -> build\lib.win-amd64-2.7 running build_ext building '_imaging' extension error: Unable to find vcvarsall.bat ---------------------------------------- Command C:\Users\Marcin\Documents\oneclickcos\Scripts\python.exe -c "import setuptools;__file__='C:\\Users\\Marcin\\Documents\\oneclickcos\\build\\PIL\\setup.py ';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record c:\users\marcin\appdata\loc al\temp\pip-dqjnaq-record\install-record.txt --install-headers C:\Users\Marcin\Documents\oneclickcos\include\site\python2.7 failed with error code 1 Storing complete log in C:\Users\Marcin\AppData\Roaming\pip\pip.log (oneclickcos) C:\Users\Marcin\Documents\oneclickcos\oneclickcos\oneclickcos>easy_install PIL Searching for PIL Reading http://pypi.python.org/simple/PIL/ Reading http://www.pythonware.com/products/pil Reading http://effbot.org/zone/pil-changes-115.htm Reading http://effbot.org/downloads/#Imaging Best match: PIL 1.1.7 Downloading http://effbot.org/media/downloads/PIL-1.1.7.tar.gz Processing PIL-1.1.7.tar.gz Running PIL-1.1.7\setup.py -q bdist_egg --dist-dir c:\users\marcin\appdata\local\temp\easy_install-r5kug5\PIL-1.1.7\egg-dist-tmp-h7kucc WARNING: '' not a valid package name; please use only.-separated package names in setup.py error: Setup script exited with error: Unable to find vcvarsall.bat (oneclickcos) C:\Users\Marcin\Documents\oneclickcos\oneclickcos\oneclickcos> -- Marcin Tustin Tel: 07773 787 105 From marcin.tustin at gmail.com Mon Jan 23 19:08:03 2012 From: marcin.tustin at gmail.com (Marcin Tustin) Date: Mon, 23 Jan 2012 18:08:03 +0000 Subject: [Image-SIG] PIL install scripts broken? In-Reply-To: References: Message-ID: Thanks - that worked! On Mon, Jan 23, 2012 at 18:03, Neru Yume wrote: > I had/have similar issues when trying to install from source on PyPy. I did > not find any solutions, but regarding workarounds - I managed to install it > for CPython by using a binary from > http://www.lfd.uci.edu/~gohlke/pythonlibs/ > >> Date: Mon, 23 Jan 2012 17:56:02 +0000 >> From: marcin.tustin at gmail.com >> To: image-sig at python.org >> Subject: [Image-SIG] PIL install scripts broken? > >> >> Hi, >> >> I just tried to install PIL on windows 7 under python 2.7.2, using >> both easy_install and pip, and neither of them will install. Instead, >> the error messages suggest that there is a problem with the install >> scripts. >> >> Does anyone have suggestions for workarounds? Is anyone maintaining >> the PIL distributions? >> >> Transcript of attempts to install follows: >> >> (oneclickcos) >> C:\Users\Marcin\Documents\oneclickcos\oneclickcos\oneclickcos>pip >> install PIL >> Downloading/unpacking PIL >> ? Running setup.py egg_info for package PIL >> ? ? WARNING: '' not a valid package name; please use only.-separated >> package names in setup.py >> >> Installing collected packages: PIL >> ? Running setup.py install for PIL >> ? ? WARNING: '' not a valid package name; please use only.-separated >> package names in setup.py >> ? ? building '_imaging' extension >> ? ? error: Unable to find vcvarsall.bat >> ? ? Complete output from command >> C:\Users\Marcin\Documents\oneclickcos\Scripts\python.exe -c "import >> setuptools;__file__='C:\\Users\\Marcin\\Documents\\oneclick >> >> cos\\build\\PIL\\setup.py';exec(compile(open(__file__).read().replace('\r\n', >> '\n'), __file__, 'exec'))" install --single-version-externally-managed >> --record c: >> \users\marcin\appdata\local\temp\pip-dqjnaq-record\install-record.txt >> --install-headers >> C:\Users\Marcin\Documents\oneclickcos\include\site\python2.7: >> ? ? WARNING: '' not a valid package name; please use only.-separated >> package names in setup.py >> >> running install >> >> running build >> >> running build_py >> >> copying PIL\ArgImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\BdfFontFile.py -> build\lib.win-amd64-2.7 >> >> copying PIL\BmpImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ContainerIO.py -> build\lib.win-amd64-2.7 >> >> copying PIL\CurImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\DcxImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\EpsImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ExifTags.py -> build\lib.win-amd64-2.7 >> >> copying PIL\FitsStubImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\FliImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\FontFile.py -> build\lib.win-amd64-2.7 >> >> copying PIL\FpxImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\GbrImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\GdImageFile.py -> build\lib.win-amd64-2.7 >> >> copying PIL\GifImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\GimpGradientFile.py -> build\lib.win-amd64-2.7 >> >> copying PIL\GimpPaletteFile.py -> build\lib.win-amd64-2.7 >> >> copying PIL\GribStubImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\IcnsImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\IcoImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\Image.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageChops.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageCms.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageColor.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageDraw.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageDraw2.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageEnhance.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageFile.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageFileIO.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageFilter.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageFont.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageGL.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageGrab.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageMath.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageMode.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageOps.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImagePalette.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImagePath.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageQt.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageSequence.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageShow.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageStat.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageTk.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageTransform.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImageWin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\ImtImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\IptcImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\JpegImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\McIdasImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\MicImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\MpegImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\MspImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\OleFileIO.py -> build\lib.win-amd64-2.7 >> >> copying PIL\PaletteFile.py -> build\lib.win-amd64-2.7 >> >> copying PIL\PalmImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\PcdImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\PcfFontFile.py -> build\lib.win-amd64-2.7 >> >> copying PIL\PcxImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\PdfImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\PixarImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\PngImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\PpmImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\PsdImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\PSDraw.py -> build\lib.win-amd64-2.7 >> >> copying PIL\SgiImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\SpiderImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\SunImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\TarIO.py -> build\lib.win-amd64-2.7 >> >> copying PIL\TgaImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\TiffImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\TiffTags.py -> build\lib.win-amd64-2.7 >> >> copying PIL\WalImageFile.py -> build\lib.win-amd64-2.7 >> >> copying PIL\WmfImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\XbmImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\XpmImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-2.7 >> >> copying PIL\__init__.py -> build\lib.win-amd64-2.7 >> >> running build_ext >> >> building '_imaging' extension >> >> error: Unable to find vcvarsall.bat >> >> ---------------------------------------- >> Command C:\Users\Marcin\Documents\oneclickcos\Scripts\python.exe -c >> "import >> setuptools;__file__='C:\\Users\\Marcin\\Documents\\oneclickcos\\build\\PIL\\setup.py >> ';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, >> 'exec'))" install --single-version-externally-managed --record >> c:\users\marcin\appdata\loc >> al\temp\pip-dqjnaq-record\install-record.txt --install-headers >> C:\Users\Marcin\Documents\oneclickcos\include\site\python2.7 failed >> with error code 1 >> Storing complete log in C:\Users\Marcin\AppData\Roaming\pip\pip.log >> >> (oneclickcos) >> C:\Users\Marcin\Documents\oneclickcos\oneclickcos\oneclickcos>easy_install >> PIL >> Searching for PIL >> Reading http://pypi.python.org/simple/PIL/ >> Reading http://www.pythonware.com/products/pil >> Reading http://effbot.org/zone/pil-changes-115.htm >> Reading http://effbot.org/downloads/#Imaging >> Best match: PIL 1.1.7 >> Downloading http://effbot.org/media/downloads/PIL-1.1.7.tar.gz >> Processing PIL-1.1.7.tar.gz >> Running PIL-1.1.7\setup.py -q bdist_egg --dist-dir >> >> c:\users\marcin\appdata\local\temp\easy_install-r5kug5\PIL-1.1.7\egg-dist-tmp-h7kucc >> WARNING: '' not a valid package name; please use only.-separated >> package names in setup.py >> error: Setup script exited with error: Unable to find vcvarsall.bat >> >> (oneclickcos) >> C:\Users\Marcin\Documents\oneclickcos\oneclickcos\oneclickcos> >> >> -- >> Marcin Tustin >> Tel: 07773 787 105 >> _______________________________________________ >> Image-SIG maillist - Image-SIG at python.org >> http://mail.python.org/mailman/listinfo/image-sig -- Marcin Tustin Tel: 07773 787 105 From tongsnelson.ise at gmail.com Fri Jan 27 17:11:31 2012 From: tongsnelson.ise at gmail.com (Nelson Tong) Date: Fri, 27 Jan 2012 11:11:31 -0500 Subject: [Image-SIG] open, show, png, blank In-Reply-To: References: Message-ID: Hi all, I tried the following to process a png file, outI = Image.open( fileOutPNGFile ) outI.show(); The code run without error, but the image return via X-windows on my linux machine is a blank image, without visible graphic on it. I am 100% positive that the image of fileOutPNGFile is not corrupted because I am able to open it via the web-browser. I tried the same code another to open another png file which I use PIL to draw and save as png. The code above is able to open and show this png file properly. why might this happen? From neruyume at hotmail.com Mon Jan 23 19:03:15 2012 From: neruyume at hotmail.com (Neru Yume) Date: Mon, 23 Jan 2012 18:03:15 +0000 Subject: [Image-SIG] PIL install scripts broken? In-Reply-To: References: Message-ID: I had/have similar issues when trying to install from source on PyPy. I did not find any solutions, but regarding workarounds - I managed to install it for CPython by using a binary from http://www.lfd.uci.edu/~gohlke/pythonlibs/ > Date: Mon, 23 Jan 2012 17:56:02 +0000 > From: marcin.tustin at gmail.com > To: image-sig at python.org > Subject: [Image-SIG] PIL install scripts broken? > > Hi, > > I just tried to install PIL on windows 7 under python 2.7.2, using > both easy_install and pip, and neither of them will install. Instead, > the error messages suggest that there is a problem with the install > scripts. > > Does anyone have suggestions for workarounds? Is anyone maintaining > the PIL distributions? > > Transcript of attempts to install follows: > > (oneclickcos) C:\Users\Marcin\Documents\oneclickcos\oneclickcos\oneclickcos>pip > install PIL > Downloading/unpacking PIL > Running setup.py egg_info for package PIL > WARNING: '' not a valid package name; please use only.-separated > package names in setup.py > > Installing collected packages: PIL > Running setup.py install for PIL > WARNING: '' not a valid package name; please use only.-separated > package names in setup.py > building '_imaging' extension > error: Unable to find vcvarsall.bat > Complete output from command > C:\Users\Marcin\Documents\oneclickcos\Scripts\python.exe -c "import > setuptools;__file__='C:\\Users\\Marcin\\Documents\\oneclick > cos\\build\\PIL\\setup.py';exec(compile(open(__file__).read().replace('\r\n', > '\n'), __file__, 'exec'))" install --single-version-externally-managed > --record c: > \users\marcin\appdata\local\temp\pip-dqjnaq-record\install-record.txt > --install-headers > C:\Users\Marcin\Documents\oneclickcos\include\site\python2.7: > WARNING: '' not a valid package name; please use only.-separated > package names in setup.py > > running install > > running build > > running build_py > > copying PIL\ArgImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\BdfFontFile.py -> build\lib.win-amd64-2.7 > > copying PIL\BmpImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\ContainerIO.py -> build\lib.win-amd64-2.7 > > copying PIL\CurImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\DcxImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\EpsImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\ExifTags.py -> build\lib.win-amd64-2.7 > > copying PIL\FitsStubImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\FliImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\FontFile.py -> build\lib.win-amd64-2.7 > > copying PIL\FpxImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\GbrImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\GdImageFile.py -> build\lib.win-amd64-2.7 > > copying PIL\GifImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\GimpGradientFile.py -> build\lib.win-amd64-2.7 > > copying PIL\GimpPaletteFile.py -> build\lib.win-amd64-2.7 > > copying PIL\GribStubImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\IcnsImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\IcoImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\Image.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageChops.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageCms.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageColor.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageDraw.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageDraw2.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageEnhance.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageFile.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageFileIO.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageFilter.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageFont.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageGL.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageGrab.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageMath.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageMode.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageOps.py -> build\lib.win-amd64-2.7 > > copying PIL\ImagePalette.py -> build\lib.win-amd64-2.7 > > copying PIL\ImagePath.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageQt.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageSequence.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageShow.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageStat.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageTk.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageTransform.py -> build\lib.win-amd64-2.7 > > copying PIL\ImageWin.py -> build\lib.win-amd64-2.7 > > copying PIL\ImImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\ImtImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\IptcImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\JpegImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\McIdasImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\MicImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\MpegImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\MspImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\OleFileIO.py -> build\lib.win-amd64-2.7 > > copying PIL\PaletteFile.py -> build\lib.win-amd64-2.7 > > copying PIL\PalmImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\PcdImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\PcfFontFile.py -> build\lib.win-amd64-2.7 > > copying PIL\PcxImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\PdfImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\PixarImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\PngImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\PpmImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\PsdImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\PSDraw.py -> build\lib.win-amd64-2.7 > > copying PIL\SgiImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\SpiderImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\SunImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\TarIO.py -> build\lib.win-amd64-2.7 > > copying PIL\TgaImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\TiffImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\TiffTags.py -> build\lib.win-amd64-2.7 > > copying PIL\WalImageFile.py -> build\lib.win-amd64-2.7 > > copying PIL\WmfImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\XbmImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\XpmImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-2.7 > > copying PIL\__init__.py -> build\lib.win-amd64-2.7 > > running build_ext > > building '_imaging' extension > > error: Unable to find vcvarsall.bat > > ---------------------------------------- > Command C:\Users\Marcin\Documents\oneclickcos\Scripts\python.exe -c > "import setuptools;__file__='C:\\Users\\Marcin\\Documents\\oneclickcos\\build\\PIL\\setup.py > ';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, > 'exec'))" install --single-version-externally-managed --record > c:\users\marcin\appdata\loc > al\temp\pip-dqjnaq-record\install-record.txt --install-headers > C:\Users\Marcin\Documents\oneclickcos\include\site\python2.7 failed > with error code 1 > Storing complete log in C:\Users\Marcin\AppData\Roaming\pip\pip.log > > (oneclickcos) C:\Users\Marcin\Documents\oneclickcos\oneclickcos\oneclickcos>easy_install > PIL > Searching for PIL > Reading http://pypi.python.org/simple/PIL/ > Reading http://www.pythonware.com/products/pil > Reading http://effbot.org/zone/pil-changes-115.htm > Reading http://effbot.org/downloads/#Imaging > Best match: PIL 1.1.7 > Downloading http://effbot.org/media/downloads/PIL-1.1.7.tar.gz > Processing PIL-1.1.7.tar.gz > Running PIL-1.1.7\setup.py -q bdist_egg --dist-dir > c:\users\marcin\appdata\local\temp\easy_install-r5kug5\PIL-1.1.7\egg-dist-tmp-h7kucc > WARNING: '' not a valid package name; please use only.-separated > package names in setup.py > error: Setup script exited with error: Unable to find vcvarsall.bat > > (oneclickcos) C:\Users\Marcin\Documents\oneclickcos\oneclickcos\oneclickcos> > > -- > Marcin Tustin > Tel: 07773 787 105 > _______________________________________________ > Image-SIG maillist - Image-SIG at python.org > http://mail.python.org/mailman/listinfo/image-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthiasbock at users.sourceforge.net Thu Jan 26 18:47:49 2012 From: matthiasbock at users.sourceforge.net (Matthias Bock) Date: Thu, 26 Jan 2012 18:47:49 +0100 Subject: [Image-SIG] PIL's PDF export dpi Message-ID: <1327600069.3769.10.camel@localhost> Dear all, Python's Imaging Library PIL seems to ignore image resolution settings, when saving as PDF. Sample code: #!/usr/bin/python2.6 # -*- coding: iso-8859-15 -*- from PIL import Image im = Image.open('demo.png') im.info['dpi'] = (300,300) im.save( 'demo.pdf', **im.info ) The (300,300) statement I added to set the resolution to 300 dpi, but nevertheless the output PDF only has 72 dpi. Can anybody help me out here ? Best, Matthias From pcousoulis at meso-scale.com Thu Jan 26 22:30:55 2012 From: pcousoulis at meso-scale.com (Cousoulis, Paul) Date: Thu, 26 Jan 2012 21:30:55 +0000 Subject: [Image-SIG] fromarray rotates image Message-ID: <26A0927F89A6AC45B7AE419B439C2D4CE9D4@msd-mb01-9238.meso-scale.com> The fromarray method is rotating the shape of arrays when converting from numpy arrays. In [56]: npArray.shape Out[56]: (650, 670) In [57]: newimage = Image.fromarray(npArray) In [58]: newimage.size Out[58]: (670, 650) In [59]: Image.VERSION Out[59]: '1.1.7' Thanks Paul ====================================================================== This electronic message transmission and any attachments are confidential and/or proprietary and may constitute legally privileged information of Meso Scale Diagnostics, LLC. The information is intended for solely the use of image-sig at python.org (image-sig at python.org). If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance of this information is strictly prohibited. You are not authorized to retain it in any form nor to re-transmit it, and you should destroy this email immediately. If you have received this electronic transmission in error, please notify us by telephone (240-631-2522) or by electronic mail to the sender of this email, Cousoulis, Paul (pcousoulis at meso-scale.com), immediately. ===================================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: From tongsnelson.ise at gmail.com Thu Jan 26 23:28:50 2012 From: tongsnelson.ise at gmail.com (Nelson Tong) Date: Thu, 26 Jan 2012 17:28:50 -0500 Subject: [Image-SIG] open, show, png, blank Message-ID: I tried the following for a png file. outI = Image.open( fileOutPNGFile ) outI.show(); The code run without error, but the image return via X-windows on my linux machine is a blank image, without visible graphic on it. I am 100% positive that the image of fileOutPNGFile is not corrupted because I am able to open it via the web-browser. I tried the same code another to open another png file which I use PIL to draw and save as png. The code above is able to open and show this png file properly. why dose this happen? From matthiasbock at users.sourceforge.net Sun Jan 29 19:38:02 2012 From: matthiasbock at users.sourceforge.net (Matthias Bock) Date: Sun, 29 Jan 2012 19:38:02 +0100 Subject: [Image-SIG] open, show, png, blank In-Reply-To: References: Message-ID: <1327862282.9555.4.camel@localhost> Am Freitag, den 27.01.2012, 11:11 -0500 schrieb Nelson Tong: > outI = Image.open( fileOutPNGFile ) > outI.show(); > > The code run without error, but the image return via X-windows on my > linux machine is a blank image, without visible graphic on it. What color is this "blank": Grey? White? Does the size match the PNG size? > I am 100% positive that the image of fileOutPNGFile is not corrupted > because I am able to open it via the web-browser. Web browsers can open corrupted image files. > I tried the same code another to open another png file which I use > PIL to draw and save as png. The code above is able to open and show > this png file properly. Sounds to me, as if the first PNG was broken. Try this: outI = Image.open( fileOutPNGFile ) outI.show() outI.save('test.png') out2 = Image.open('test.png') out2.show() > why might this happen? If the code doesn't help solving the issue, could you send the PNG to the list? Cheers, Matthias From chris.barker at noaa.gov Tue Jan 31 19:18:22 2012 From: chris.barker at noaa.gov (Chris Barker) Date: Tue, 31 Jan 2012 10:18:22 -0800 Subject: [Image-SIG] fromarray rotates image In-Reply-To: <26A0927F89A6AC45B7AE419B439C2D4CEFB7@msd-mb01-9238.meso-scale.com> References: <26A0927F89A6AC45B7AE419B439C2D4CE9D4@msd-mb01-9238.meso-scale.com> <26A0927F89A6AC45B7AE419B439C2D4CEFB7@msd-mb01-9238.meso-scale.com> Message-ID: On Tue, Jan 31, 2012 at 8:38 AM, Cousoulis, Paul wrote: > I'm sorry but I still think there is a bug. I still don't think so: explanation below. By the way, there is another problem with your example -- I get an all-black second image. I think you need to specify the image mode when you create the new image: newimage = Image.fromarray(npArray, mode=image1.mode) though that still makes a mess of it! -- more debugging to be done here -- see below > In [4]: print image1.size > (516, 356) > > In [5]: npArray = np.array(image1.getdata()) > > In [6]: print npArray.shape > (183696L,) OK so far > In [7]: npArray.shape = image1.size > In [8]: print npArray.shape > (516L, 356L) here I would swap -- as numpy naturally stores data the other way: and now it works: In [8]: run pil-numpy-test.py input image size: (516, 356) numpy image shape before: (183696,) numpy image shape after: (356, 516) new image size (516, 356) (though the colors are still screwed up -- I don't know what's up with that...) I can see how you'd expect it to work the way you had it, but I think the problem is that you are mixing two ways to push raw data to/froim numpy arrays: npArray = np.array(image1.getdata()) is using PIL's getdata() to put the raw data in a string, then turning that into a numpy array (oh, and that may be the source of teh data mess up too...np.array is expecting a sequence of numbers or something, not raw data -- you want: OOPS, actually, getdata returns something else altogether: """ getdata im.getdata() => sequence Returns the contents of an image as a sequence object containing pixel values. The sequence object is flattened, so that values for line one follow directly after the values of line zero, and so on. Note that the sequence object returned by this method is an internal PIL data type, which only supports certain sequence operations, including iteration and basic sequence access. To convert it to an ordinary sequence (e.g. for printing), use list(im.getdata()). """ so it should be: npArray = np.fromstring(image1.tostring(), dtype=np.uint8) npArray.shape = (image1.size[1], image1.size[0] ) and that now works -- correct size, and correct final image. However: newimage = Image.fromarray(npArray) is using the numpy "array protocol", which is a bit different than fromstring/tostring -- it carries shape information -- hence the need to specify the shape of the numpy array as I did. you can use that protocol both ways: npArray = np.asarray(image1) which then preserved size info. Here's my new version: from PIL import Image import numpy as np image1 = Image.open("LineGraph.tif") print image1 print "input image size:", image1.size npArray = np.asarray(image1) print "numpy image shape after:", npArray.shape newimage = Image.fromarray(npArray, mode=image1.mode) print newimage print "new image size", newimage.size newimage.save("LineGraph2.tif") NOTE: if you do fromstring/tostring (or tobuffer) consistently, then it doesn't matter what shape you make the numpy array: image1 = Image.open("LineGraph.tif") print image1 print "input image size:", image1.size npArray = np.fromstring(image1.tostring(), dtype=np.uint8) print "numpy image shape:", npArray.shape newimage = Image.fromstring(image1.mode, image1.size, npArray.tostring()) print newimage print "new image size", newimage.size newimage.save("LineGraph2.tif") But that's less efficient, and messier. NOTE: it might have been nicer if the array protocol were used such that the array created was fortran-order, and thus (w,h) in shape, but so it goes. HTH, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R ? ? ? ? ? ?(206) 526-6959?? voice 7600 Sand Point Way NE ??(206) 526-6329?? fax Seattle, WA ?98115 ? ? ??(206) 526-6317?? main reception Chris.Barker at noaa.gov From chris.barker at noaa.gov Tue Jan 31 22:54:41 2012 From: chris.barker at noaa.gov (Chris Barker) Date: Tue, 31 Jan 2012 13:54:41 -0800 Subject: [Image-SIG] [SPAM] - Re: fromarray rotates image - Email found in subject In-Reply-To: <26A0927F89A6AC45B7AE419B439C2D4CF09F@msd-mb01-9238.meso-scale.com> References: <26A0927F89A6AC45B7AE419B439C2D4CE9D4@msd-mb01-9238.meso-scale.com> <26A0927F89A6AC45B7AE419B439C2D4CEFB7@msd-mb01-9238.meso-scale.com> <26A0927F89A6AC45B7AE419B439C2D4CF09F@msd-mb01-9238.meso-scale.com> Message-ID: On Tue, Jan 31, 2012 at 1:15 PM, Cousoulis, Paul wrote: > The second image is a 32 bit tif, so you need to use something like ImageJ or Fiji. not in the code you sent -- it was just garbage, but that wasn't the issue you were testing here. > Microsoft image viewer won't work. Why in the world would I even try that? ;-) > I think I shouldn't have to fiddle with the row/column order, If you use the same method to convert to/from numpy, then you don't need to fiddle with it. You only needed to fiddle if you used one method to go one way, and a different method to go the other. > but I guess ?it needs to stay the way it is. I do agree that it's not ideal like this, but not bad, once you expect it. -Chris Thanks for the help. > > Paul > > -----Original Message----- > From: Chris Barker [mailto:chris.barker at noaa.gov] > Sent: Tuesday, January 31, 2012 1:18 PM > To: Cousoulis, Paul; image-sig at python.org > Subject: [SPAM] - Re: [Image-SIG] fromarray rotates image - Email found in subject > > > > On Tue, Jan 31, 2012 at 8:38 AM, Cousoulis, Paul wrote: >> I'm sorry but I still think there is a bug. > > I still don't think so: explanation below. > > By the way, there is another problem with your example -- I get an all-black second image. I think you need to specify the image mode when you create the new image: > > newimage = Image.fromarray(npArray, mode=image1.mode) > > though that still makes a mess of it! -- more debugging to be done here -- see below > >> In [4]: print image1.size >> (516, 356) >> >> In [5]: npArray = np.array(image1.getdata()) >> >> In [6]: print npArray.shape >> (183696L,) > > OK so far > > >> In [7]: npArray.shape = image1.size > >> In [8]: print npArray.shape >> (516L, 356L) > > here I would swap -- as numpy naturally stores data the other way: > > and now it works: > > In [8]: run pil-numpy-test.py > input image size: (516, 356) numpy image shape before: (183696,) numpy image shape after: (356, 516) new image size (516, 356) > > (though the colors are still screwed up -- I don't know what's up with that...) > > I can see how you'd expect it to work the way you had it, but I think the problem is that you are mixing two ways to push raw data to/froim numpy arrays: > > npArray = np.array(image1.getdata()) > > is using PIL's getdata() to put the raw data in a string, then turning that into a numpy array (oh, and that may be the source of teh data mess up too...np.array is expecting a sequence of numbers or something, not raw data -- you want: > > OOPS, actually, getdata returns something else altogether: > > """ > getdata > > im.getdata() => sequence > > Returns the contents of an image as a sequence object containing pixel values. The sequence object is flattened, so that values for line one follow directly after the values of line zero, and so on. > > Note that the sequence object returned by this method is an internal PIL data type, which only supports certain sequence operations, including iteration and basic sequence access. To convert it to an ordinary sequence (e.g. for printing), use list(im.getdata()). > """ > so it should be: > > npArray = np.fromstring(image1.tostring(), dtype=np.uint8) > > npArray.shape = (image1.size[1], image1.size[0] ) > > and that now works -- correct size, and correct final image. > > However: > > newimage = Image.fromarray(npArray) > > is using the numpy "array protocol", which is a bit different than fromstring/tostring -- it carries shape information -- hence the need to specify the shape of the numpy array as I did. > > you can use that protocol both ways: > > npArray = np.asarray(image1) > > which then preserved size info. > > Here's my new version: > > from PIL import Image > import numpy as np > > > image1 = Image.open("LineGraph.tif") > print image1 > print "input image size:", image1.size > > npArray = np.asarray(image1) > > print "numpy image shape after:", npArray.shape > > newimage = Image.fromarray(npArray, mode=image1.mode) > > print newimage > print "new image size", newimage.size > > newimage.save("LineGraph2.tif") > > > NOTE: if you do fromstring/tostring (or tobuffer) consistently, then it doesn't matter what shape you make the numpy array: > > > image1 = Image.open("LineGraph.tif") > print image1 > print "input image size:", image1.size > > npArray = np.fromstring(image1.tostring(), dtype=np.uint8) > > print "numpy image shape:", npArray.shape > > newimage = Image.fromstring(image1.mode, image1.size, npArray.tostring()) > > print newimage > print "new image size", newimage.size > > newimage.save("LineGraph2.tif") > > But that's less efficient, and messier. > > NOTE: it might have been nicer if the array protocol were used such that the array created was fortran-order, and thus (w,h) in shape, but so it goes. > > HTH, > > ? -Chris > > > > > -- > > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R ? ? ? ? ? ?(206) 526-6959?? voice > 7600 Sand Point Way NE ??(206) 526-6329?? fax Seattle, WA ?98115 ? ? ??(206) 526-6317?? main reception > > Chris.Barker at noaa.gov -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R ? ? ? ? ? ?(206) 526-6959?? voice 7600 Sand Point Way NE ??(206) 526-6329?? fax Seattle, WA ?98115 ? ? ??(206) 526-6317?? main reception Chris.Barker at noaa.gov From tongsnelson.ise at gmail.com Tue Jan 31 19:38:25 2012 From: tongsnelson.ise at gmail.com (Nelson Tong) Date: Tue, 31 Jan 2012 13:38:25 -0500 Subject: [Image-SIG] open, show, png, blank In-Reply-To: <1327862282.9555.4.camel@localhost> References: <1327862282.9555.4.camel@localhost> Message-ID: thanks for reply, Matthias, when I use "show()", the image appears to have an all-white background, nothing else is on it. The size does indeed match the png size , I used the following to confirm: x, y = outIm.size print "size of outImg: " + str(x)+" " + str(y); I tries to resave the png as a png image with a different name using PIL and show() of the 2nd png image still appear to have all-white background with nothing on it. but If I open the images (both the 1st and the re-saved image ) with the command line command of "display", I can see the images via ImageMagick. Attached is example image which I am having problem with. Can you reproduce the same problem I'm seeing with this image, possibly due to the png image being broken? -N. On 1/29/12, Matthias Bock wrote: > Am Freitag, den 27.01.2012, 11:11 -0500 schrieb Nelson Tong: > >> outI = Image.open( fileOutPNGFile ) >> outI.show(); >> >> The code run without error, but the image return via X-windows on my >> linux machine is a blank image, without visible graphic on it. > > What color is this "blank": Grey? White? > Does the size match the PNG size? > >> I am 100% positive that the image of fileOutPNGFile is not corrupted >> because I am able to open it via the web-browser. > > Web browsers can open corrupted image files. > >> I tried the same code another to open another png file which I use >> PIL to draw and save as png. The code above is able to open and show >> this png file properly. > > Sounds to me, as if the first PNG was broken. > > Try this: > > outI = Image.open( fileOutPNGFile ) > outI.show() > outI.save('test.png') > out2 = Image.open('test.png') > out2.show() > >> why might this happen? > > If the code doesn't help solving the issue, > could you send the PNG to the list? > > Cheers, Matthias > > -------------- next part -------------- A non-text attachment was scrubbed... Name: gcp.png Type: image/png Size: 1060277 bytes Desc: not available URL: From pcousoulis at meso-scale.com Tue Jan 31 22:15:36 2012 From: pcousoulis at meso-scale.com (Cousoulis, Paul) Date: Tue, 31 Jan 2012 21:15:36 +0000 Subject: [Image-SIG] [SPAM] - Re: fromarray rotates image - Email found in subject In-Reply-To: References: <26A0927F89A6AC45B7AE419B439C2D4CE9D4@msd-mb01-9238.meso-scale.com><26A0927F89A6AC45B7AE419B439C2D4CEFB7@msd-mb01-9238.meso-scale.com> Message-ID: <26A0927F89A6AC45B7AE419B439C2D4CF09F@msd-mb01-9238.meso-scale.com> The second image is a 32 bit tif, so you need to use something like ImageJ or Fiji. Microsoft image viewer won't work. I think I shouldn't have to fiddle with the row/column order, but I guess it needs to stay the way it is. Thanks for the help. Paul -----Original Message----- From: Chris Barker [mailto:chris.barker at noaa.gov] Sent: Tuesday, January 31, 2012 1:18 PM To: Cousoulis, Paul; image-sig at python.org Subject: [SPAM] - Re: [Image-SIG] fromarray rotates image - Email found in subject On Tue, Jan 31, 2012 at 8:38 AM, Cousoulis, Paul wrote: > I'm sorry but I still think there is a bug. I still don't think so: explanation below. By the way, there is another problem with your example -- I get an all-black second image. I think you need to specify the image mode when you create the new image: newimage = Image.fromarray(npArray, mode=image1.mode) though that still makes a mess of it! -- more debugging to be done here -- see below > In [4]: print image1.size > (516, 356) > > In [5]: npArray = np.array(image1.getdata()) > > In [6]: print npArray.shape > (183696L,) OK so far > In [7]: npArray.shape = image1.size > In [8]: print npArray.shape > (516L, 356L) here I would swap -- as numpy naturally stores data the other way: and now it works: In [8]: run pil-numpy-test.py input image size: (516, 356) numpy image shape before: (183696,) numpy image shape after: (356, 516) new image size (516, 356) (though the colors are still screwed up -- I don't know what's up with that...) I can see how you'd expect it to work the way you had it, but I think the problem is that you are mixing two ways to push raw data to/froim numpy arrays: npArray = np.array(image1.getdata()) is using PIL's getdata() to put the raw data in a string, then turning that into a numpy array (oh, and that may be the source of teh data mess up too...np.array is expecting a sequence of numbers or something, not raw data -- you want: OOPS, actually, getdata returns something else altogether: """ getdata im.getdata() => sequence Returns the contents of an image as a sequence object containing pixel values. The sequence object is flattened, so that values for line one follow directly after the values of line zero, and so on. Note that the sequence object returned by this method is an internal PIL data type, which only supports certain sequence operations, including iteration and basic sequence access. To convert it to an ordinary sequence (e.g. for printing), use list(im.getdata()). """ so it should be: npArray = np.fromstring(image1.tostring(), dtype=np.uint8) npArray.shape = (image1.size[1], image1.size[0] ) and that now works -- correct size, and correct final image. However: newimage = Image.fromarray(npArray) is using the numpy "array protocol", which is a bit different than fromstring/tostring -- it carries shape information -- hence the need to specify the shape of the numpy array as I did. you can use that protocol both ways: npArray = np.asarray(image1) which then preserved size info. Here's my new version: from PIL import Image import numpy as np image1 = Image.open("LineGraph.tif") print image1 print "input image size:", image1.size npArray = np.asarray(image1) print "numpy image shape after:", npArray.shape newimage = Image.fromarray(npArray, mode=image1.mode) print newimage print "new image size", newimage.size newimage.save("LineGraph2.tif") NOTE: if you do fromstring/tostring (or tobuffer) consistently, then it doesn't matter what shape you make the numpy array: image1 = Image.open("LineGraph.tif") print image1 print "input image size:", image1.size npArray = np.fromstring(image1.tostring(), dtype=np.uint8) print "numpy image shape:", npArray.shape newimage = Image.fromstring(image1.mode, image1.size, npArray.tostring()) print newimage print "new image size", newimage.size newimage.save("LineGraph2.tif") But that's less efficient, and messier. NOTE: it might have been nicer if the array protocol were used such that the array created was fortran-order, and thus (w,h) in shape, but so it goes. HTH, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R ? ? ? ? ? ?(206) 526-6959?? voice 7600 Sand Point Way NE ??(206) 526-6329?? fax Seattle, WA ?98115 ? ? ??(206) 526-6317?? main reception Chris.Barker at noaa.gov ====================================================================== This electronic message transmission and any attachments are confidential and/or proprietary and may constitute legally privileged information of Meso Scale Diagnostics, LLC. The information is intended for solely the use of recipient (recipient). If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance of this information is strictly prohibited. You are not authorized to retain it in any form nor to re-transmit it, and you should destroy this email immediately. If you have received this electronic transmission in error, please notify us by telephone (240-631-2522) or by electronic mail to the sender of this email, Cousoulis, Paul (pcousoulis at meso-scale.com), immediately. =====================================================================