[Image-SIG] ImportError at /admin/photo_manager/invisibleindividual/1/ The _imaging C module is not installed
I realize that there is info out there on this (e.g., in StackOverflow), but one person says place it in the dll file, another something else ... I am using Python 2.7 in Windows Vista - do I need to add/remove something to get this module loaded? - Sanjiv ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] PNG patch for reading zTXt chunks
Hi I have found your article PNG patch for reading zTXt chunks I have a zTXtComment that I cannot read. Perhaps you can help me (It might be french): 7A 54 58 74 43 6F 6D 6D 65 6E 74 00 00 78 DA AB 53 30 B3 34 33 B5 30 B6 B0 B4 30 B6 30 31 B3 34 37 34 33 35 B7 30 B7 54 A8 03 00 4F E9 05 EB BB 83 12 84 Thanks a lot in advance and greetings from Switzerland Hannes ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] PIL Installation Issue: 2.6
Hi, I am having trouble installing PIL 1.1.7 for Python 2.6 for Windows 7. I get the error message: Installation requires Python 2.6, which was not found in the registry I used the script found herehttp://effbot.org/zone/python-register.htm, and added some print statements. The script runs with the following values: version = 2.6 installpath = C:\Python26 regpath = SOFTWARE\Python\Pythoncore\2.6\ pythonpath = C:\Python26;C:\Python26\Lib\;C:\Python26\DLLs\ QueryValue(reg, installkey) = C:\Python26\ QueryValue(reg, pythonkey) = C:\Python26\Lib;C:\Python26\DLLs;C:\Python26\Lib\lib-tk After running the script, it prints: *** Unable to register! *** You probably have another Python installation! Therefore, the register key is opening successfully. The QueryValue results seem to be very close to the expected values (installpath and pythonpath). Any suggestions why the PIL installer is not seeing the Python interpreter, despite it being located where it would be expected, and the key being found in the registry? I would appreciate any suggestions. Thanks, Reid ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] bug report: PIL install does not find libjpeg...
Hi! pip install PIL fails in finding libjpeg, zlib, ... resulting in multiple *** LIBNAME support not available. The reason is that PIL setup.py does not look for libs into /usr/lib/x86_64-linux-gnu, where libjpeg, zlib and other are located. The provided patch solves the issue. I am using debian sid x86_64, but I am sure this bug affects other people. Regards, -- Félix 214a215,216 add_directory(library_dirs, /usr/lib/x86_64-linux-gnu) add_directory(library_dirs, /usr/lib/i386-linux-gnu) ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] IOError: encoder error -2 when writing image file
Hi guys, When I try to save the image, I always get this error: img.save(jpeg,'JPEG') File D:\Program Files\Python27\lib\site-packages\PIL\Image.py, line 1439, in save save_handler(self, fp, filename) File D:\Program Files\Python27\lib\site-packages\PIL\JpegImagePlugin.py, line 471, in _save ImageFile._save(im, fp, [(jpeg, (0,0)+im.size, 0, rawmode)]) File D:\Program Files\Python27\lib\site-packages\PIL\ImageFile.py, line 501, in _save raise IOError(encoder error %d when writing image file % s) IOError: encoder error -2 when writing image file Is there anyone who can help me solve this problem? Thanks. Lipeng ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] Reg:Image Transfer
Dear friends, I am using Python 2.7.3. I like to transfer a image file via python to RabbitMQ so I configured image lib in my system. I am using the below program for the image transfer channel.exchange_declare(exchange='testing_room1',type='direct',durable= True,) channel.queue_declare(queue='Testing', durable=True) data=D:\\P.jpg file=jpeg.compress(data, w, h, b) message =file channel.basic_publish(exchange='testing_room1',routing_key='testing', body=message) But I am getting the error while running the program. Requesting your guidance. Thanks and Regards Robert tona felix.J ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
Re: [Image-SIG] Adding Python 3 support
On 2012-10-09 20:26:37 +, Brian Crowell said: On Tue, Oct 9, 2012 at 3:11 PM, Mark Sienkiewicz sienk...@stsci.edu wrote: From what I read of Pillow, they aren't really interested in maintaining a copy of PIL. Do you mean to fork Pillow, or try to persuade them to let you help maintain it? I want to contribute code that would make Pillow Python 3-capable so that Debian/Ubuntu might pick it up, and Python 3 developers would finally have their PIL back. I gathered from the notes that Pillow was a continuation of PIL as a fork, and since it's active, I expect it will be more attractive to the distros than a straight port of PIL 1.1.7. I hoped to hear from Alex Clark. He looks like the main contributor. And I just happened to be wandering by, sorry. You can always email me directly: acl...@aclark.net. I drift in and out of this list (via GMANE). Great to hear folks discussing this! My take: - I recently spoken with Felix Schwarz who works on Fedora. He was asking about the status of PIL, and I recommend (after some careful thought) that Pillow be adopted by Fedora. So, with what I just read about Debian in this thread, I think that means we have two Linux distros ready to include Pillow? - For a while Pillow did nothing but packaging-related fixes. Then I began to consider tracking PIL which means that we'll release an image code fix if it's tracked upstream (either by ticket or commit). - Then I began to consider Python 3 support. At this point, I'm in favor adding Python 3 support to Pillow using the best of of all the recent attempts. I don't plan to do the work myself, but I'll gladly help anyone that wants to tackle it. As for what to do about supporting old Python versions: nothing. Pillow has a nice series of releases on PyPI for anyone that needs to support older Python versions[1], so whatever old versions of Python 3 need to be dropped to make this work is fine with me. I'd say supporting Python 2.7 and 3.3 feels right. Maybe we'll call the Python 3 compatible version of Pillow Pillow 2.0. Lastly, I've roughly targetted PyCon 2013 as the date to have Python 3 support added to Pillow. I'm not sure if this is overly-ambitious or overly-generous. Alex [1] We could even backport fixes to the 1.x series of Pillow, given enough volunteers. --Brian ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig -- Alex Clark · https://www.gittip.com/aclark4life/___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
Re: [Image-SIG] Adding Python 3 support
On 2012-10-10 19:31:35 +, Mark Sienkiewicz said: On 10/10/12 15:07, Alex Clark wrote: - Pillow started as a packaging fork, but I now consider image code fixes if they are tracked upstream (by ticket or commit). Does that mean you are looking for a ticket filed against the old PIL for each of the python 3 modifications? If not, how does this policy interact with the python 3 support? Not for each of the modifications but maybe an Add Python 3 support ticket to the pil-radcliffe-2009 branch to make sure we fly above the radar. IIUC some bit of Python 3 support has been added to PIL somewhere, it's just not released yet. So one scenario is: add that code to Pillow and release it. ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig -- Alex Clark · https://www.gittip.com/aclark4life/___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] help: how to add words on a image
Hi there: I have a need to add words to a image, just a watermark considering the image maybe black or white, so it's not good to to define the font color of the watermark, what i want is to add a shadow to the words, set the background of the font to white and the shadow to black. I explore the docs still no idea how to implement this. can you help me with this? really thanks. ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] [BUG - minor][1.1.7] ImageDraw.Draw.rectangle - box argument
*ImageDraw.Draw.rectangle : - v1.1.7* It is stated in the docs that the second coordinates pair of the box argument defines a point just *outside* the rectangle, but defines in fact a point located *inside* the rectangle *ex :* im = Image.new('1', (10,10), 0) draw = ImageDraw.Draw(im) # according to doc, the following rectangle size is (4,4) draw.rectangle((0,0,4,4), fill=0xff) # to check, pixel (4,4) should be black, as outside the drawn rectangle im.getpixel((4,4)) 255 # Problem ! ;) ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] PIL for python 3.X?
Is there a version of PIL that will run with python 3.3? If not, are there plans to support 3.3 and, if so, is there any release schedule? Thanks very much. Steve Buroff attachment: image001.gif ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] Problems converting hierarchical (pyramidal) TIFF images
I am doing some image processing on images. I use PIL to resize the images. The image in question is a multilayered TIFF image. When I run it through my code, all I get is an image with a green background and no detail. It is as if the image is being corrupted, or not being read correctly by PIL. I have got the repro case down to a few lines of python code. -- import os import sys import Image import ImageFile import StringIO data = None with open(sys.argv[1]) as fp: data = fp.read() img = Image.open(StringIO.StringIO(data)) print img.format, img.size, img.mode, img.getbands() #img.show() img1 = img.convert(RGB) print img1.format, img1.size, img1.mode, img1.getbands() #img1.show() out = StringIO.StringIO() img1.save (out, JPEG , quality=95) with open(sys.argv[2], 'w') as f: f.write(out.getvalue()) -- At each step if you comment out the img.show() I get an image with a green background, and no detail I pass in inputfile outputfile as arguments to this tool Here is the source image URL: http://feroze.s3.amazonaws.com/ptiff_file.jpg Any idea what I am doing wrong? Thanks, feroze. ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
Re: [Image-SIG] Python 3 port -- first pass finished
Hello Brian et al, Thanks for your work! There are some issues with Python3 fork (I don't know if they apply to main Pillow though): 1) Test running doesn't work for me. python Tests/run.py fails with many obscure errors: running test_numpy ... === error 256 Traceback (most recent call last): File Tests/test_numpy.py, line 1, in module from tester import * File /Users/kmike/svn/Pillow/Tests/tester.py, line 1, in module from __future__ import print_function ImportError: No module named __future__ py.test and nosetest can't even collect the tests from Tests folder so something strange is happening :) It would be great to run PIL tests using tox, but the supplied tox.ini config runs only selftest.py (which is broken under Python3, but that's an another issue, see https://github.com/fluggo/Pillow/pull/1 ). 2) fromstring and tostring methods are gone in Python3 version. They have unfortunate names but I think it is better not to break the interface. For example, I'm writing a Python 2/3 library that uses PIL and this change breaks it under Python3. What do you think about issuing a deprecation warning instead? ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] Changing output resolution when converting EPS file to PNG in Python Imaging Library
I wrote a simple implementation of PIL to convert a list of EPS files to PNG images. The problem is the PNG image is of pretty low quality. When I save the image using im.save(file.png, dpi = (1000, 1000)) the increased DPI does not result in a higher quality image. I believe this is due to the im = Image.open(file.eps) importing in low resolution. Is there a way to import the EPS file into a higher resolution im object? Thanks in advance. I also have a stackoverflow question about this matter but haven't received any fixes. It is here http://stackoverflow.com/questions/12900435/changing-output-resolution-when-converting-eps-file-to-png-in-python-imaging-libin case you would like to see my script. Thanks again. Brandon ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
Re: [Image-SIG] PIL: Unexpected results with Image.paste on RGBA images with transparency.
Hi Lars, On Mon, Oct 29, 2012 at 4:05 PM, Lars Ruoff lars.ru...@gmail.com wrote: Any other comments? Alex, Pillow says: Please report any non-packaging related issues here first: - https://bitbucket.org/effbot/pil-2009-raclette/issues Should i report the issue there? Yes please. Lars On Mon, Oct 29, 2012 at 4:33 PM, Alex Clark acl...@aclark.net wrote: On 2012-10-29 15:05:28 +, Lars Ruoff said: Hi, I'm new to this list, so excuse me if this is a known issue. I didn't find anything on it on the net so far but didn't have time to search much. I have observed what i consider a flaw in the Image.paste algorithm when used with transparent images. transparent-columns.png is an image with 3 vertical black columns with alpha=0.5, 0.2 and transparent respectively. transparent-bars.png is an image with 2 horizontal black bars with transparent and alpha=0.5 respectively. (images attached) When these two images are transparently pasted one over the other, using the following code: from PIL import Image source = Image.open('transparent-**columns.png') result = Image.open('transparent-bars.**png') result.paste(source, (0, 0), source) result.save('transparent-**columns-on-bars-pil.png') The result is unexpectet to say the least. PIL seems to modify the transparency even in regions where only one of the images has non-transparent values. Very wrong in my opinion. Doing the same manipulation in GIMP 2.6 gives what i consider the expected result. (attached for reference) I guess the per-pixel transparency of the result should be result_alpha = 1 - (1-alpha1)*(1-alpha2), where alpha1,alpha2 are the alpha channel values from the original images. You are welcome to submit a patch to Pillow (the friendly PIL fork) here: - https://github.com/python-**imaging/Pillowhttps://github.com/python-imaging/Pillow Speaking of that, can anyone review: - https://github.com/python-**imaging/Pillowhttps://github.com/python-imaging/Pillow Also, I'm looking for a few folks willing to stand up and regularly review image code fixes. I know nothing about that code, and plan to stick with being the release manager only. I'll be doing a 1.7.8 release soon (by the end of this month) then maybe Pillow 1.8 will contain support for Python 3.3 (and cut everything before 2.7). Regards, Lars Ruoff image image image image image image __**_ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/**mailman/listinfo/image-sighttp://mail.python.org/mailman/listinfo/image-sig -- Alex Clark · https://www.gittip.com/**aclark4life/https://www.gittip.com/aclark4life/ __**_ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/**mailman/listinfo/image-sighttp://mail.python.org/mailman/listinfo/image-sig -- Alex Clark · http://aclark.net ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] Problems converting multi-layered TIFF images
I am doing some image processing on images. I use PIL to resize the images. The image in question is a multilayered TIFF image. When I run it through my code, all I get is an image with a green background and no detail. It is as if the image is being corrupted, or not being read correctly by PIL. I have got the repro case down to a few lines of python code. -- import os import sys import Image import ImageFile import StringIO data = None with open(sys.argv[1]) as fp: data = fp.read() img = Image.open(StringIO.StringIO(data)) print img.format, img.size, img.mode, img.getbands() #img.show() img1 = img.convert(RGB) print img1.format, img1.size, img1.mode, img1.getbands() #img1.show() out = StringIO.StringIO() img1.save (out, JPEG , quality=95) with open(sys.argv[2], 'w') as f: f.write(out.getvalue()) -- At each step if you comment out the img.show() I get an image with a green background, and no detail I pass in inputfile outputfile as arguments to this tool Here is the source image URL: http://feroze.s3.amazonaws.com/ptiff_file.jpg Any idea what I am doing wrong? Thanks, feroze. ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
[Image-SIG] Unable to read multilayered TIFF images using PIL 1.1.7
I am doing some image processing on images. I use PIL to resize the images. The image in question is a multilayered TIFF image. When I run it through my code, all I get is an image with a green background and no detail. It is as if the image is being corrupted, or not being read correctly by PIL. I have got the repro case down to a few lines of python code. -- import os import sys import Image import ImageFile import StringIO data = None with open(sys.argv[1]) as fp: data = fp.read() img = Image.open(StringIO.StringIO(data)) print img.format, img.size, img.mode, img.getbands() #img.show() img1 = img.convert(RGB) print img1.format, img1.size, img1.mode, img1.getbands() #img1.show() out = StringIO.StringIO() img1.save (out, JPEG , quality=95) with open(sys.argv[2], 'w') as f: f.write(out.getvalue()) -- At each step if you comment out the img.show() I get an image with a green background, and no detail I pass in inputfile outputfile as arguments to this tool Here is the source image URL: http://feroze.s3.amazonaws.com/ptiff_file.jpg Any idea what I am doing wrong? Thanks, feroze. ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
Re: [Image-SIG] PIL: Unexpected results with Image.paste on RGBA images with transparency.
Any other comments? Alex, Pillow says: Please report any non-packaging related issues here first: - https://bitbucket.org/effbot/pil-2009-raclette/issues Should i report the issue there? Lars On Mon, Oct 29, 2012 at 4:33 PM, Alex Clark acl...@aclark.net wrote: On 2012-10-29 15:05:28 +, Lars Ruoff said: Hi, I'm new to this list, so excuse me if this is a known issue. I didn't find anything on it on the net so far but didn't have time to search much. I have observed what i consider a flaw in the Image.paste algorithm when used with transparent images. transparent-columns.png is an image with 3 vertical black columns with alpha=0.5, 0.2 and transparent respectively. transparent-bars.png is an image with 2 horizontal black bars with transparent and alpha=0.5 respectively. (images attached) When these two images are transparently pasted one over the other, using the following code: from PIL import Image source = Image.open('transparent-**columns.png') result = Image.open('transparent-bars.**png') result.paste(source, (0, 0), source) result.save('transparent-**columns-on-bars-pil.png') The result is unexpectet to say the least. PIL seems to modify the transparency even in regions where only one of the images has non-transparent values. Very wrong in my opinion. Doing the same manipulation in GIMP 2.6 gives what i consider the expected result. (attached for reference) I guess the per-pixel transparency of the result should be result_alpha = 1 - (1-alpha1)*(1-alpha2), where alpha1,alpha2 are the alpha channel values from the original images. You are welcome to submit a patch to Pillow (the friendly PIL fork) here: - https://github.com/python-**imaging/Pillowhttps://github.com/python-imaging/Pillow Speaking of that, can anyone review: - https://github.com/python-**imaging/Pillowhttps://github.com/python-imaging/Pillow Also, I'm looking for a few folks willing to stand up and regularly review image code fixes. I know nothing about that code, and plan to stick with being the release manager only. I'll be doing a 1.7.8 release soon (by the end of this month) then maybe Pillow 1.8 will contain support for Python 3.3 (and cut everything before 2.7). Regards, Lars Ruoff image image image image image image __**_ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/**mailman/listinfo/image-sighttp://mail.python.org/mailman/listinfo/image-sig -- Alex Clark · https://www.gittip.com/**aclark4life/https://www.gittip.com/aclark4life/ __**_ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/**mailman/listinfo/image-sighttp://mail.python.org/mailman/listinfo/image-sig ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
Re: [Image-SIG] Python 3 port -- first pass finished
On Mon, Oct 29, 2012 at 2:11 PM, Mikhail Korobov kmik...@gmail.com wrote: 1) Test running doesn't work for me. python Tests/run.py ... ImportError: No module named __future__ It would be an awfully odd version of Python that didn't recognize a __future__ import. What version of Python is this, and where did it come from? py.test and nosetest can't even collect the tests from Tests folder so something strange is happening :) It would be great to run PIL tests using tox, but the supplied tox.ini config runs only selftest.py (which is broken under Python3, but that's an another issue, see https://github.com/fluggo/Pillow/pull/1 ). I wasn't sure how to tackle selftest.py, so I didn't touch it. I saw your commit to fix it in your own repository: https://github.com/kmike/Pillow/commit/eac71dd8493af7a9bb15f48c63941f5d0b6c763f If that works, I think I'll just borrow your commit. I'm not familiar with tox. The Tests directory is grafted onto stock Pillow, so nothing else was configured to use the tests there. 2) fromstring and tostring methods are gone in Python3 version. They have unfortunate names but I think it is better not to break the interface. For example, I'm writing a Python 2/3 library that uses PIL and this change breaks it under Python3. What do you think about issuing a deprecation warning instead? That's a good idea. tobytes/frombytes work in both versions, so I should issue a deprecation warning that says to switch to those names. --Brian ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig
Re: [Image-SIG] PIL for python 3.X?
On Sun, Oct 21, 2012 at 1:28 PM, Steven Buroff sbur...@optonline.net wrote: Is there a version of PIL that will run with python 3.3? If not, are there plans to support 3.3 and, if so, is there any release schedule? Thanks very much. We're working on creating a version that works with Python 2.6/2.7 and 3.2/3.3. Alex is looking to do a release later this year; he can chime in about the timing. You can help us by testing the version found at: https://github.com/fluggo/Pillow --Brian ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig