Re: [Image-SIG] What is the best way to anti-alias a very large resolution image in PIL

2011-10-10 Thread Fredrik Lundh
Looks like you've found a working approach, but I'm still a bit curious what "crash" means here -- do you get a segmentation violation or a MemoryError exception? PIL needs about 2G to load that image into memory and an additional 50% of that to finish the resizing (it's done in two passes), so yo

Re: [Image-SIG] webp support?

2011-06-29 Thread Fredrik Lundh
I just added WebP support to the development tree; see: http://offline.effbot.org/europython for code snippets and links. 2010/11/24 Josh Bleecher Snyder : > Hi, > > I was wondering whether webp support (encoding, decoding) was on the > PIL roadmap. > > I was going to hack together a cPython

Re: [Image-SIG] Locate The Center of WhiteDot from a Image

2011-01-11 Thread Fredrik Lundh
2011/1/8 Narendra Sisodiya : > PS: I have looked at centroid algorithm, It is again going at pixel level > and that will be slow. My application will become better with faster > centroid algorithm. Well, you only have to process the part of the image that contains your dot. If it occupies 10% of

Re: [Image-SIG] Putting a unicode string on an ImageDraw canvas

2011-01-10 Thread Fredrik Lundh
2011/1/10 Thomas Larsen Wessel : > Thanks :) > > Here is an example that shows how both draw.text and draw.textsize works, as > long as a unicode-supported font is supplied. It also shows how to get the > text size directly from the font object. > > import ImageFont, Image, ImageDraw > > s = u'\u06

Re: [Image-SIG] Putting a unicode string on an ImageDraw canvas

2011-01-10 Thread Fredrik Lundh
2011/1/10 Thomas Larsen Wessel : > People are telling me that PIL supports unicode strings, does it? And if > yes, why does the following not work: > > import ImageFont, Image, ImageDraw > s = u'\u0623\u0636\u0641' > im = Image.new('RGB', (200,200)) > draw = ImageDraw.Draw(im) > draw.text((40,40),

Re: [Image-SIG] ANN: PIL 1.2 pre-alpha (January 8, 2011)

2011-01-10 Thread Fredrik Lundh
2011/1/9 Glenn Linderman : > On 1/7/2011 5:41 PM, Fredrik Lundh wrote: > > It also builds under Python 3.1 and 3.2 beta, even if > the functionality is currently *very* limited under Python 3.X. > > Is there any doc that describes what does or doesn't work under 3.X? Beyo

Re: [Image-SIG] IOError: decoder zip not available

2011-01-07 Thread Fredrik Lundh
I would expect when things are working correctly. > > Is there anything else I can check? > > Thanks for your help. > Adam > > > > On 1/7/2011 3:33 PM, Fredrik Lundh wrote: >> >> python -c "import _imaging; print _imaging.__file__" > ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig

[Image-SIG] ANN: PIL 1.2 pre-alpha (January 8, 2011)

2011-01-07 Thread Fredrik Lundh
A pre-alpha snapshot of the upcoming PIL 1.2 release is now available from: http://hg.effbot.org/pil-2009-raclette/downloads/PIL-1.2a0-20110108.tar.gz or via Mercurial, from https://bitbucket.org/effbot/pil-2009-raclette I've decided to abandon the planned 1.1.8 release, including the rough an

Re: [Image-SIG] IOError: decoder zip not available

2011-01-07 Thread Fredrik Lundh
The setup output looks fine, so my guess is that your script isn't picking up the same build as the one you get when you run the test script. Running the following command in your PIL build directory and your script directory will tell you what files Python are using: python -c "import _imaging;

Re: [Image-SIG] Convert to Black and White to an image

2011-01-07 Thread Fredrik Lundh
2011/1/7 Narendra Sisodiya : > Can somebody give an easy way to convert a image into black and white using > a given threshold.. > > Currently I am doing like this > >     image=ImageOps.grayscale(image) >     for i in range(0,width): >         for j in range(0,height): >             if image.getpi

Re: [Image-SIG] PIL for python 2.7?

2011-01-07 Thread Fredrik Lundh
2011/1/2 Michael Fahy : > Will there be a version of PIL for Python 2.7? PIL 1.1.7 works well with 2.7, out of the box. Binaries for Windows has been available under the "additional downloads" link on http://pythonware.com/products/pil/ for some time, and I just added the missing link to the page

Re: [Image-SIG] PIL

2011-01-07 Thread Fredrik Lundh
2010/12/1 Rajajothini Sureshkumar : > Hello, > > I would like to down load pill version 1.1.7 for Python2.6 . > But I have Python 2.7 on my pc. > I wonder this is not a problem If you're using PIL on Windows, you need the version that matches your Python installation. I've added the missing 2.7 li

Re: [Image-SIG] PIL on Python 3?

2011-01-07 Thread Fredrik Lundh
2010/12/18 Rohan Pai : > The current version of PIL I installed is version 1.1.7 for Python 2.6, and > when I try to run it on Python 3, it doesn't work. I know the syntaxes like > print "Hello World" and raw_input() are actually print ("Hello World") and > input(). I don't know the other syntaxes

Re: [Image-SIG] [PATCH; python-imaging-sane] Py_*_ALLOW_THREADS for sane_get_devices and sane_open calls

2011-01-07 Thread Fredrik Lundh
Added to trunk. Thanks! /F 2010/12/28 Sandro Mani : > Hi, following patch also adds Py_*_ALLOW_THREADS macros around the > sane_get_devices and sane_open calls which can take a long time especially > if network-scanners are accessed. > > --- Imaging-1.1.7.orig/Sane/_sane.c    2009-11-01 01:44:12.0

Re: [Image-SIG] [python-imaging-sane] get_devices and threading

2011-01-07 Thread Fredrik Lundh
Well, I'd say scanning falls under the "image stuff" umbrella, and the Sane bindings are shipped with the PIL source code... I don't know much about them, though, but I suspect this is a Python GIL issue. 2010/12/28 Edward Cannon : > wrong mailing list, this is for PIL and related topics only.

Re: [Image-SIG] bug in version 1.1.7

2011-01-07 Thread Fredrik Lundh
Yep, it's a known bug in 1.1.7. Trivial patch here: http://hg.effbot.org/pil-2009-raclette/changeset/355 2010/12/26 Kevin Paulus : > > > Hello All and Merry Christmas, > > I've found a bug and verified it with several of my > Slackware fanatics: it seems that Pil 1.1.7 (python 2.6.4 ) > > when

Re: [Image-SIG] Does the ImageTk.PhotoImage support alpha channels?

2011-01-07 Thread Fredrik Lundh
2010/12/20 : > Does the ImageTk.PhotoImage support alpha channels? If not, are there > any plans to add support for this feature or is the lack of this > functionality a limitation of Tkinter? Yes, RGBA images are supported. In versions before 8.4, the A layer is handled as a mask, not a true al

Re: [Image-SIG] import ICCProfile Error

2010-11-14 Thread Fredrik Lundh
ags.desc.get("Macintosh", p.tags.desc.get("en", {}).get("US", "ICC > Profile".encode("latin1", "replace")[:79] >     #except ImportError: >     name = "ICC Profile" > > and it works fine. Still couldn

Re: [Image-SIG] import ICCProfile Error

2010-11-14 Thread Fredrik Lundh
On Sun, Nov 14, 2010 at 3:46 PM, Bharathwaaj Srinivasan wrote: > Hi, > > I tried from the command line. Still getting error. Please see the log. > > bhar...@bharath-laptop:~/workspace/webKit$ python2.5 > Python 2.5.5 (r255:77872, Nov  3 2010, 13:18:19) > [GCC 4.4.5] on linux2 > Type "help", "copyr

Re: [Image-SIG] import ICCProfile Error

2010-11-13 Thread Fredrik Lundh
baked state (i.e. "PIL" has been removed, but code for "PIL.PngImagePlugin" is still around). You're not importing PIL code directly, are you? On Sat, Nov 13, 2010 at 3:17 PM, Fredrik Lundh wrote: > By the way, I'm pretty sure that this only happens for some

Re: [Image-SIG] import ICCProfile Error

2010-11-13 Thread Fredrik Lundh
By the way, I'm pretty sure that this only happens for some PNG images, and once you upload your application, PNG reading is done by GAE:s image library, not PIL, so the application you're building should be fine. On Sat, Nov 13, 2010 at 2:40 PM, Fredrik Lundh wrote: > On Fri, No

Re: [Image-SIG] import ICCProfile Error

2010-11-13 Thread Fredrik Lundh
out the problematic code (or you could try replacing the relative import with a "from PIL import" and see if that helps). > On 13 November 2010 02:04, Fredrik Lundh wrote: >> >> On Fri, Nov 12, 2010 at 7:30 PM, Bharathwaaj Srinivasan >> wrote: >> > I keep

Re: [Image-SIG] import ICCProfile Error

2010-11-12 Thread Fredrik Lundh
On Fri, Nov 12, 2010 at 7:30 PM, Bharathwaaj Srinivasan wrote: > I keep getting error in import ICCProfile in PNGImagePlugin.py _save. > > What am I missing? Which package contains ICCProfile? Not sure why that code was left in there, but iirc it's an extension hook. > I've been searching but co

Re: [Image-SIG] PIL Image array interface has the wrong size for YCbCr

2010-11-09 Thread Fredrik Lundh
On Wed, Nov 10, 2010 at 12:08 AM, David Coles wrote: > Nice! > > Is http://hg.effbot.org/pil-2009-raclette the current trunk? There seems > to be a bit of confusion of which is the current repository. Quite handy > when trying to write patches. > > The ones I've seen are: > > http://effbot.org/zon

Re: [Image-SIG] Problem with psd and Alpha

2010-11-09 Thread Fredrik Lundh
On Thu, Aug 5, 2010 at 10:42 AM, Martino Massalini wrote: > Hi, i'm tryng to composite several psd coming from my render software. > Each one is a psd with  the same size of the others and an alpha channel. > The problem is when i do > > im = Image.open("filepath") > > I alway get a "RGB" image in

Re: [Image-SIG] Hi I have problems with tif files

2010-11-09 Thread Fredrik Lundh
On Wed, Sep 22, 2010 at 7:24 AM, Rajan Gurjar wrote: > Image.open('filename') and im.info gives the following > > (640, 480) > {'resolution': (1, 1), 'compression': 'raw'} > F;32BF Where did the "F;32BF" come from? > TIFF > > > But when I run the im.show() it gives the following error. im.s

Re: [Image-SIG] How to change size of PIL fonts?

2010-11-09 Thread Fredrik Lundh
On Tue, Oct 12, 2010 at 1:31 PM, Dévji Chhãngã wrote: > Hello Image-SIG, > I am a newbie to PIL, I have following code > >     def __setFont (self, filename): >         pilfont = ImageFont.load(filename) >         return pilfont > >     def drawImage (self): >         cg = CaptchaString(4) >      

Re: [Image-SIG] Read SVG files - extracting the path

2010-11-09 Thread Fredrik Lundh
On Fri, Oct 8, 2010 at 6:59 PM, Sebastian Koblinger wrote: > Hi everybody! > > I'm new to Python as well as to this mailing list and this is my question: > > Is it possible to read a path provided by an SVG file, and based on that > path, make a selection of an image? > (Further I'd like to inver

Re: [Image-SIG] Reading a 8bit Tif image from ArcMAP doesnt read well

2010-11-09 Thread Fredrik Lundh
On Thu, Oct 28, 2010 at 6:56 PM, German Ocampo wrote: > The issue is that using PIL I get pixel values in the greyscale of 127 > or rgb(0,0,0), where really I could see in Gimp that these pixels have > a different value. Looks like PIL can decode part of the picture and > another part of the pict

Re: [Image-SIG] PIL Image array interface has the wrong size for YCbCr

2010-11-08 Thread Fredrik Lundh
Just committed a fix to trunk (including some simple tests for this operation & mode...). Thanks! /F On Fri, Oct 8, 2010 at 6:51 AM, David Coles wrote: > PIL's Image class has incorrect dimension specified for YCbCr images. > This causes issues when converting to or from NumPy arrays. > > Accord

Re: [Image-SIG] 64 bit _imaging.so

2010-11-08 Thread Fredrik Lundh
On Tue, Sep 28, 2010 at 1:43 AM, Donald Price wrote: > I am now running opensuse 11.3 on an HP computer with i7-860 processor. Have > loaded python 2.6.5 and it works fine except for  PIL. I can import  PIL, > Image, and ImageDraw. But when I import ImageFont or try to use Image I get > the error

Re: [Image-SIG] Digital Number

2010-11-08 Thread Fredrik Lundh
On Sun, Sep 19, 2010 at 12:19 PM, wrote: > How to read pixel wise Digital Number (DN) of a JPG image using PIL? You mean "Digital Number" in the ancient GIS sense? I.e. simply the value of a pixel? The simplest way is to use getpixel(pos) where pos is a (x, y) tuple: http://effbot.org/tag

Re: [Image-SIG] A question

2010-11-06 Thread Fredrik Lundh
2010/10/7 אלי : > I wrote the python script below usind word editor. > > 1. How can I run it as a python script? It seems to be opened as a word > document! As Don said, use a text editor that can produce plain text files. In addition to the ones he mentioned, you can use IDLE which is included i

Re: [Image-SIG] PIL and swapping colors

2010-11-06 Thread Fredrik Lundh
On Fri, Nov 5, 2010 at 7:16 AM, loz.accs wrote: > Hi, everyone! > PIL doesn't provide screenshots making on linux, so I wrote > C-extension that uses Imlib2 to grab screenshots in raw RGBA format > and returns it to python interpreter. > > Image object (Image.fromstring) was created successfully,

Re: [Image-SIG] Bug: ImageFilter.py GaussianBlur radius not set

2010-11-06 Thread Fredrik Lundh
On Thu, Oct 7, 2010 at 8:08 PM, Even wrote: > The constructor for GaussianBlur class accepts the argument radius, with > default value 2, > but it does nothing with this argument, and instead hardcodes the radius to > 2. > Below is the code found in PIL 1.1.7: > class GaussianBlur(Filter): >     n

Re: [Image-SIG] Building Imaging 1.1.7 on CentOS 4 x86_64

2010-11-06 Thread Fredrik Lundh
On Wed, Oct 27, 2010 at 9:41 AM, Atro Tossavainen wrote: > Hello, > > I've got libjpeg-devel installed, but doing a > > python setup.py build > > with a Python 2.6.6 install that I made myself, against Imaging 1.1.7, > results in no JPEG support.  The same process works just fine on i386 > CentOS

Re: [Image-SIG] Unable to import _imaging

2010-11-06 Thread Fredrik Lundh
On Sat, Nov 6, 2010 at 10:30 PM, Esben Bugge wrote: > Hi > > I am trying to install PIL on Mac OS.X 10.6 for the purpose of using > Satchmo. After installation I tried > > $ python import PIL import Image import _imaging > Traceback (most recent call last): >   File "", line 1, in

Re: [Image-SIG] PIL error with encoder

2010-08-04 Thread Fredrik Lundh
coderconfig) >   File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 401, in > _getencoder >     raise IOError("encoder %s not available" % encoder_name) > IOError: encoder zip not available > > Thank you, >          Dhruv > +1-510-931-6347 &

Re: [Image-SIG] PIL error with encoder

2010-08-02 Thread Fredrik Lundh
2010/8/2 Dhruv Majumdar : > Im new to Python and have been struggling with this error during tests: > > IOError: encoder zip not available > > I have python 2.7 with zlib, jpeg and freetype installed on the server. When > building PIL it shows support for all three above. However i notice at > Ima

Re: [Image-SIG] Pillow, the "friendly" PIL fork

2010-08-01 Thread Fredrik Lundh
2010/8/1 Christopher Barker : > I'd be a bit happier if "import Image" raised a deprecation warning, but I'm > not sure how you'd do that. (I actually did help do that for the GDAL > package, but that was set up differently - they actually had all their stuff > dumped directly into site-packages).

Re: [Image-SIG] Pillow, the "friendly" PIL fork

2010-08-01 Thread Fredrik Lundh
2010/8/1 Alex Clark : > So if I understand you correctly, Fredrik, you are saying that you are > adhering to what was once a standard and that you are skeptical about new > standards (which is certainly reasonable). The great thing with standards is that there are so many to chose from :-) But s

Re: [Image-SIG] bug in docs for Image.rotate()

2010-08-01 Thread Fredrik Lundh
2010/7/22 Bill Janssen : > Bill Janssen wrote: > >> Hmmm, the docs say that Image.rotate() has a "filter" keyword arg, but >> the code says that it's really "resample".  Note that the docstring in >> the code is wrong, too.  This is 1.1.6 I'm looking at. > > Also wrong in 1.1.7.  And, in Image.rot

Re: [Image-SIG] PIL: TIFF images loaded as 16 bit signed integers

2010-08-01 Thread Fredrik Lundh
2010/7/6 Chris Mitchell : > I'm running into a problem where my image intensities are being loaded > as 16 bit signed integers.  The code I'm using to open the tiff file > is: > > im = Image.open(file) > self.pixels = np.array([im.getdata()], np.uint16) > > the filetype is a 16bit TIFF, whose inten

Re: [Image-SIG] IOError("cannot identify image file")

2010-08-01 Thread Fredrik Lundh
2010/7/14 Steve McFarlin : > I can not seem to figure out why I am getting the cannot identify image file > error. The image in question is a PNG. This PNG file can be loaded by PIL on > another system. The PIL tests passed when installing. Is there something I > there a common place to look to

Re: [Image-SIG] bug in docs for Image.rotate()

2010-08-01 Thread Fredrik Lundh
2010/7/22 Bill Janssen : > Hmmm, the docs say that Image.rotate() has a "filter" keyword arg, but > the code says that it's really "resample".  Note that the docstring in > the code is wrong, too.  This is 1.1.6 I'm looking at. Sounds like the good old "named positional arguments" vs "keyword argu

Re: [Image-SIG] Pillow, the "friendly" PIL fork

2010-08-01 Thread Fredrik Lundh
2010/7/31 Daniel Fetchinson : >> I have been wanting to tackle this for sometime, and finally got around to >> it tonight. I've created a "friendly" fork of PIL called "Pillow": >> http://pypi.python.org/pypi/Pillow/1.0 >> >> Some background: I've been doing Plone development for the past 5 years o

Re: [Image-SIG] Pillow, the "friendly" PIL fork

2010-08-01 Thread Fredrik Lundh
2010/8/1 Jerome Leclanche : > Although the "PIL" and "Image*" packages themselves do not > respect python standards (should be from imaging import .., or > something alike). If you had been paying attention, you'd noticed that "python standards" change all the time, depend on what the latest mini

Re: [Image-SIG] PIL Query

2010-07-18 Thread Fredrik Lundh
PIL is a image manipulation/graphics library for Python, and it doesn't provide any standard functions for e.g. plotting data on maps or serving them from a web server. From your description, it sounds like you're using some application that uses PIL, so you might want to contact the authors of th

Re: [Image-SIG] Python Imaging Library for Windows Mobile

2010-06-20 Thread Fredrik Lundh
I'm not aware of any ports. In fact, I'm not aware of any current ports of Python itself to that platform (there are some older projects, but they seem pretty stale). In general, PIL works everywhere you have Python and a working C compiler / C runtime environment (even if building it might take

Re: [Image-SIG] Getting PIL to work on OSX Snow Leopard

2010-06-20 Thread Fredrik Lundh
2010/6/5 Simon Mosk-Aoyama : > Chris, > Thanks so much for the suggestion! > I ran the otool command and noted that the _imaging.so is linked to the > wrong (newer) libjpeg: > > simon@/Users/simon/: otool -L PIL/_imaging.so > PIL/_imaging.so: >         /opt/local/lib/libjpeg.8.dylib (compatibility

Re: [Image-SIG] McIdas Image Plugin

2010-06-17 Thread Fredrik Lundh
2010/6/17 Reymer Antonio Vargas Solano : > Hello > >  I trying to use the McIdasImagePlugin.py, We have a lot of old McIdas area > files on some disc, and we are trying to get information about the files. so > I'm trying to write an script get information about the files, for e.g the > original dat

Re: [Image-SIG] PIL Consuming All System Resources

2010-05-30 Thread Fredrik Lundh
esn't work for all formats) 2010/5/30 Yury V. Zaytsev : > Hi! > > On Sun, 2010-05-30 at 14:59 +0200, Fredrik Lundh wrote: >> The file has mode=RGB size=20400x28079, so you'd need about 2291246400 >> bytes to load it all into memory at once, and twice that to do e.g.

Re: [Image-SIG] PIL Consuming All System Resources

2010-05-30 Thread Fredrik Lundh
The file has mode=RGB size=20400x28079, so you'd need about 2291246400 bytes to load it all into memory at once, and twice that to do e.g. color conversion (which creates a second image memory), so it's a bit on the big side, at least for a 32-bit environment. Note that PIL doesn't actually read t

Re: [Image-SIG] broken data stream when reading image file

2010-05-29 Thread Fredrik Lundh
The confusion here is that setup.py reports what it identified, and what parts it told the distutils system to build (expecting distutils to yell if something went wrong), while the selftest.py reports what it actually found for the PIL build it managed to import. Usually, having the first one bui

Re: [Image-SIG] Python-PIL bug report

2010-05-28 Thread Fredrik Lundh
Your operating system has a limit to the amount of files that you can have open in a single program, and the error message simply tells you that you've exceeded this limit. To work around this, you can: -- avoid holding on to the objects returned by Image.open(); either process the data as you go

Re: [Image-SIG] Installing libjpeg

2010-05-26 Thread Fredrik Lundh
PIL's setup.py script (which uses Python's standard "distutils" build mechanisms) work the same was as the venerable "make" utility (1); that is, if a target exists and is newer than the source files, it's assumed to be correct. This is great when you change only a few source files, but less great

Re: [Image-SIG] Loading Imaging 1.1.7

2010-05-26 Thread Fredrik Lundh
Looks like the Hair Designer is actually using PIL, but Edward's advice still stands, I think. If the vendor cannot help you (they should), there's another thread in this forum right now about PIL binaries for Mac, complete with links to downloads (look for "PIL binaries -- please test"). Make su

Re: [Image-SIG] Does libjpeg-8a work in PIL?

2010-05-16 Thread Fredrik Lundh
Looks like they just replaced 8a with 8b. I've built and tested PIL with the 8b release, and all my JPEG tests seem to work just fine, so it should be safe to use. On Thu, May 13, 2010 at 7:07 PM, Fredrik Lundh wrote: > I haven't tested it specifically, but from a quick look a

[Image-SIG] PIL windows binaries for Python 2.7b2 now available

2010-05-15 Thread Fredrik Lundh
Available from the usual place: http://effbot.org/downloads/#pil ___ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig

Re: [Image-SIG] Does libjpeg-8a work in PIL?

2010-05-13 Thread Fredrik Lundh
I haven't tested it specifically, but from a quick look at the release notes, they don't seem to have changed any API:s, so it should work. In case you need the original, a copy of it seems to be available from here: http://code.google.com/p/quirkysoft/downloads/detail?name=jpegsrc.v6b.tar.gz (l

Re: [Image-SIG] Image warping in Python or PIL

2010-05-08 Thread Fredrik Lundh
On Sat, May 8, 2010 at 5:58 AM, Son Hua wrote: > Hi, > > Can anybody show me some hints on how to implement an image warping function > efficiently in Python or PIL? Suppose we have a function f(x, y) -> (x', y') > that warps a pixel location (x, y) to (x', y'). Because (x', y') may end up > to be

Re: [Image-SIG] Mac support for PIL

2010-05-07 Thread Fredrik Lundh
Do you have the necessary support libraries on your machine? (see the README file). There are prebuilt versions out there too; maybe some Mac hackers can chime in and point you to the latest and greatest. On Wed, May 5, 2010 at 10:42 PM, Paul Ross wrote: > Hi there and I'm sorry to bother you

Re: [Image-SIG] weird windows 7 error with ImageFont

2010-05-05 Thread Fredrik Lundh
What binaries are we talking about? I'm pretty sure the effbot.org binaries have _imagingft in them, at least: $ unzip -v PIL-1.1.7.win32-py2.6.exe ... 324608 Defl:N 170249 48% 11-02-09 13:42 5462e136 PLATLIB/PIL/_imaging.pyd 101376 Defl:N51319 49% 11-02-09 13:42 cdd53308 PLAT

Re: [Image-SIG] Image perspective with PIL

2010-05-03 Thread Fredrik Lundh
I've added the documentation from the original patch to this page: http://effbot.org/tag/pil.Image.Image.transform The next text is attached below. im.transform(size, PERSPECTIVE, data) im.transform(size, PERSPECTIVE, data, filter) Applies a perspective transform to the image, and places t

Re: [Image-SIG] python PIL 16-bit tiff files

2010-04-25 Thread Fredrik Lundh
y", line 374, in > _getdecoder > return apply(decoder, (mode,) + args + extra) > ValueError: unknown raw mode* > > Am I missing a value to pass into convert() to tell it to make an 8bit > file? > > Thanks, > > > > On 25 April 2010 13:48, Fredrik

Re: [Image-SIG] Radius bug with GaussianBlur

2010-04-25 Thread Fredrik Lundh
On Mon, Mar 1, 2010 at 10:49 PM, Stani wrote: > Strange indeed. The same is true for UnsharpMask: More silly than strange, I'd say -- looks like a cut-and-paste-propagated typo that weren't caught by the (rather shallow) filter tests. Trivial patch here: http://hg.effbot.org/pil-2009-raclet

Re: [Image-SIG] python PIL 16-bit tiff files

2010-04-25 Thread Fredrik Lundh
10 at 1:07 PM, Fredrik Lundh wrote: > This isn't really a full solution, but the following patch at least > allows PIL to read 3x16-bit RGB TIFF files, converting them on the fly > to 24-bit RGB.  Note that it requires new binaries to handle little > endian (intel) files: > &

Re: [Image-SIG] python PIL 16-bit tiff files

2010-04-25 Thread Fredrik Lundh
t way to handle more "obscure" TIFF flavours), but at least the version I have doesn't handle 16-bit images well either. I need to think a bit more about this, I think... On Thu, Apr 22, 2010 at 10:57 PM, Fredrik Lundh wrote: > Oh, missed that there was one in your first post.

Re: [Image-SIG] bug in PIL 1.1.7 Image.split()

2010-04-25 Thread Fredrik Lundh
A patch for this can be found here: http://hg.effbot.org/pil-2009-raclette/changeset/fb7ce579f5f9 On Fri, Dec 11, 2009 at 12:55 AM, Fredrik Lundh wrote: > Good catch. The breakage is caused by a 1.1.7 fix that treats > single-band images as a special case; unfortunately, the fix

Re: [Image-SIG] python PIL 16-bit tiff files

2010-04-22 Thread Fredrik Lundh
Oh, missed that there was one in your first post. I'm a bit busy right now, but I'll take a look when I find some spare time. On Thu, Apr 22, 2010 at 10:56 PM, Fredrik Lundh wrote: > On Tue, Apr 13, 2010 at 10:52 AM, Dan Blacker > wrote: >> Hey guys, >> >>

Re: [Image-SIG] python PIL 16-bit tiff files

2010-04-22 Thread Fredrik Lundh
On Tue, Apr 13, 2010 at 10:52 AM, Dan Blacker wrote: > Hey guys, > > Thanks for your input, > > The image is only of a tiny cropped area of a long strip of color kodachrome > film - I will send a better example with some more color in it when I get a > chance. > > I was under the impression that P

Re: [Image-SIG] DPI

2010-04-22 Thread Fredrik Lundh
Resolution info is optional in JPEG files (it's a part of the JFIF standard, not JPEG itself) and even if present, it may not be expressed in dots per inch. PIL only sets the "dpi" field if the information is there, leaving it to your code to provide a suitable default value (or behaviour) for you

Re: [Image-SIG] problem with PIL 1.1.7 on OSX10.4

2010-04-22 Thread Fredrik Lundh
Just guessing, but have you installed Xcode? On Tue, Apr 20, 2010 at 6:55 AM, mark greeley wrote: > hi, im trying to get PIL on my mac. i have osx10.4, python 2.6.5, and PIL > 1.1.7 > > I get the error > > gcc-4.0 -arch ppc -arch i386 -fno-strict-aliasing -fno-common -dynamic > -DNDEBUG -g -O

Re: [Image-SIG] AccessInit: hash collision: 3 for both 1 and 1

2010-04-18 Thread Fredrik Lundh
2010/4/18 Łukasz Langa : > This is not a proper reply in terms of e-mail but I registered just a second > ago just to write this post. So, here goes, replying to Frederik's message > from Thu Apr 08 15:01:06 2010: > > Are you using some virtual env thing that might move modules around, > btw? I tr

Re: [Image-SIG] AccessInit: hash collision: 3 for both 1 and 1

2010-04-08 Thread Fredrik Lundh
Are you using some virtual env thing that might move modules around, btw? I tried messing with the path to see if I could trick Python into importing the same thing twice on Windows, but failed under 2.6. On Thu, Apr 8, 2010 at 9:06 PM, Fredrik Lundh wrote: > The error should only occur

Re: [Image-SIG] AccessInit: hash collision: 3 for both 1 and 1

2010-04-08 Thread Fredrik Lundh
oogling led me to someone mentioning that this happened after he'd used easy_install, but that it went away after rebuilding with setup.py. How did you build your copy? On Thu, Apr 8, 2010 at 8:17 PM, Bill Janssen wrote: > Fredrik Lundh wrote: > >> The idea is that add_item should

Re: [Image-SIG] Trying to convert JPG image to .Sig , How?

2010-04-08 Thread Fredrik Lundh
What's a ".sig format signature"? If you want to embed a JPEG image in a mail, you need to read up on the MIME mail format and Python's email package (http://docs.python.org/library/email). Traditional sigs are usually plain text, though, so maybe you meant something else? On Thu, Apr 8, 2010

Re: [Image-SIG] AccessInit: hash collision: 3 for both 1 and 1

2010-04-08 Thread Fredrik Lundh
The idea is that add_item should only be called once for each mode (see ImagingAccessInit). What did you do to trick Python into calling the module initializer multiple times? On Mon, Apr 5, 2010 at 4:41 AM, Bill Janssen wrote: > Seems to me that in libImaging, Access.c:add_item should really

Re: [Image-SIG] _grabscreen???

2010-04-01 Thread Fredrik Lundh
I'm afraid ImageGrab isn't available for Mac OS X; it's Windows only in 1.1.7. (Contributions from mac hackers are welcome!) On Thu, Apr 1, 2010 at 1:17 AM, Scott Hastings wrote: > Hi, > > I'm having a difficult time using the python imaging library on my mac. >  Being naive, I installed a uni

Re: [Image-SIG] (no subject)

2010-03-31 Thread Fredrik Lundh
I have a rough 3.X port sitting in a local repo, waiting for some spare cycles to do a bit of merging to get it up to par with the 1.1.7 release. Once that's done, I'll post the repo somewhere so more people can hammer on it. Stay tuned. On Tue, Mar 23, 2010 at 5:42 AM, Clement Chan wrote: >

Re: [Image-SIG] language lawyer needed: PIL fails on Adobe Illustrator EPS...

2010-03-21 Thread Fredrik Lundh
Haven't checked the DSC spec in ages, but given your observation, it'd probably make sense to skip all non-DSC comments no matter what the spec actually says. Can you provide a patch (or a sample file)? On Sat, Mar 20, 2010 at 11:13 PM, Bill Janssen wrote: > I think I need a language lawyer.  

Re: [Image-SIG] PIL Fonts

2010-03-20 Thread Fredrik Lundh
On Sat, Mar 20, 2010 at 9:10 PM, clive sinclair wrote: > I am running Python 2.6 and have just installed PIL 1.1.7 running on Win > 2000. > > When I try to get a font object eg by > font = ImageFont.truetype("C:\WINNT\Fonts\arial.ttf", 15) > I get an exception >  File "C:\Python26\lib\site-package

Re: [Image-SIG] Desperate GUI Help Please!!

2010-03-16 Thread Fredrik Lundh
The Tkinter toolkit comes with a canvas widget that's probably a better choice for the drawing parts of your application. Tkinter itself is a bit outside the scope for this mailing list; you'll probably have more luck on the tkinter-discuss list: http://mail.python.org/mailman/listinfo/tkinte

Re: [Image-SIG] window 7 and PIL 1.1.7

2010-03-14 Thread Fredrik Lundh
On Sun, Mar 14, 2010 at 2:47 PM, Fredrik Lundh wrote: > 32-bit or 64-bit Windows 7 (and Python)?  The PythonWare builds are all > 32-bit. At this time, at least -- I'm looking into ways to get 64-bit builds into the normal workflow. In the meantime, contributions are welcome (that

Re: [Image-SIG] window 7 and PIL 1.1.7

2010-03-14 Thread Fredrik Lundh
32-bit or 64-bit Windows 7 (and Python)? The PythonWare builds are all 32-bit. PIL uses the standard Python binary installers, so you might want to look for solutions in other Python forums as well. And if nothing else helps, there's always this: http://effbot.org/zone/python-register.htm

Re: [Image-SIG] ImageStat silent convert

2010-03-11 Thread Fredrik Lundh
Sounds like a bug. What does the getextrema() method return for the same image? On Wed, Feb 17, 2010 at 6:57 AM, Laura & Edward Cannon wrote: > while using PIL 1.16 recently, I noticed that ImageStat seems to do a > silent convert to mode L when given a mode F image. Looping though the > image

Re: [Image-SIG] Bug Report: PIL font management clipping tops of characters (addendum)

2010-03-11 Thread Fredrik Lundh
Some issues related to this were fixed in 1.1.7, but there are apparently a few more things that can go wrong. Some of this is caused by semi-weird font metrics in some truetype files; the internal API relies on being able to determine a pixel-level bounding box before rendering, and it's likely t

Re: [Image-SIG] PIL PNG encoding performance

2010-03-11 Thread Fredrik Lundh
On Fri, Mar 5, 2010 at 11:23 AM, Oliver Tonnhofer wrote: > > On 04.03.2010, at 14:31, Oliver Tonnhofer wrote: >> >> Any opinions or suggestions on that? I would do a fork on bitbucket then >> and start hacking. > > Ok, I just started :) > I added compress_level and compress_type as save options fo

Re: [Image-SIG] Problem w/ .jpg on Windows

2010-03-11 Thread Fredrik Lundh
Is this a prebuilt version or something you built yourself? It might be that the selftest picks a different PYD file than your stand-alone script. Adding "print Image.core" to your test script will tell you what version the script is picking up; compare that to the "loaded from" lines in the test

Re: [Image-SIG] PIL 1.1.6 can't convert 16-bit (I; 16) to 8-bit ('L')--Windows 32-bit

2010-03-02 Thread Fredrik Lundh
PIL has very limited support for the I;16 and I;16L modes; it's usually best to convert them to mode I (or F) and move on from there. Try doing: im = im.convert("I") before applying getextrema and point(lut, "L") to the image. On Mon, Mar 1, 2010 at 4:50 AM, Karl Garsha wrote: > Greetings,

Re: [Image-SIG] proble loading font

2010-02-11 Thread Fredrik Lundh
What platform is this? If you start a Python interpreter and write: >>> import Image >>> Image.core what does it output? On Wed, Feb 3, 2010 at 10:06 AM, ariel goldstien wrote: > Hi. > My name is Ariel Goldstien I work at The Hebrew university laboratory. > I am trying to write a Heb

Re: [Image-SIG] How to pass the address of the buffer to Image.frombuffer()

2010-02-11 Thread Fredrik Lundh
2010/1/26 Веселин : > I want to display captured frames from a webcam. I am using > video4linux2, v4l2 bindings for python and ctypes. > > I am also using Tk. In the main loop of my v4l2 app, after Q_BUF, > STREAM_ON, DQ_BUF I call method that looks something like that: > > > window = Tkinter.Tk()

Re: [Image-SIG] compatibility

2010-02-11 Thread Fredrik Lundh
On Thu, Feb 11, 2010 at 10:51 PM, Mathews, Leah Nicole wrote: > Hello, > >> We are currently using Python Imaging Library 1.1.6 and evaluating >> for use with snow leopard. Is it compatible and >> what is the version that is compatible? I'm not aware of any known incompatibilities with any versio

Re: [Image-SIG] delayed mail

2010-02-11 Thread Fredrik Lundh
(and of course that mail got caught by the filter as well. argh!) On Thu, Feb 11, 2010 at 9:06 PM, Fredrik Lundh wrote: > sorry for the delays in mail handling; I've been on the road more or > less constantly since late november, and more mails than usual have > ended up in

[Image-SIG] delayed mail

2010-02-11 Thread Fredrik Lundh
sorry for the delays in mail handling; I've been on the road more or less constantly since late november, and more mails than usual have ended up in the moderation queues lately (most of it is indeed spam, but not everything...). ___ Image-SIG maillist

Re: [Image-SIG] Is PIL 1.1.7 final "official"

2009-12-11 Thread Fredrik Lundh
Yeah, 1.1.7 is official; it's just me having accidentally skipped a couple of steps in the release procedure. Will fix asap. Sorry for the confusion. On Wed, Dec 9, 2009 at 5:43 AM, Steven Watanabe wrote: > I see that PIL 1.1.7 final has been released: > > http://offline.effbot.org/ann-pil-11

Re: [Image-SIG] bug in PIL 1.1.7 Image.split()

2009-12-10 Thread Fredrik Lundh
Good catch. The breakage is caused by a 1.1.7 fix that treats single-band images as a special case; unfortunately, the fix checks that attribute before actually loading the image... I'll provide a patch later, but you can of course work around it by adding an explicit load to your code. Thanks /F

Re: [Image-SIG] Problem with optimize flag and GIF encoder

2009-11-29 Thread Fredrik Lundh
Hmm. PIL doesn't officially support "optimize" for GIF files: http://effbot.org/imagingbook/format-gif.htm so maybe this is some partially implemented feature that's been hiding in there for ages. I'm not sure GIF is such a great format for thumbnails anyway; maybe the toolkit should be twe

Re: [Image-SIG] had to hack setup.py to find tk.h

2009-11-26 Thread Fredrik Lundh
Which versions of PIL and Ubuntu? (I'm pretty sure I built this successfully on 9.10.) On Thu, Nov 26, 2009 at 3:57 PM, Michael P. Soulier wrote: > Hi, > > I'm on an Ubuntu system and I had to add this to setup.py to get PIL to > build with the Tk extension. > >  add_directory(include_dirs, "/

Re: [Image-SIG] Example Code for Displaying Pictures--I'm Stumped

2009-11-26 Thread Fredrik Lundh
On Thu, Nov 26, 2009 at 3:05 AM, Bill Janssen wrote: >        # Note: Don't try and use frombuffer(..); different versions of >        # PIL will orient the image differently. >        pil_image = Image.fromstring( >            format, (image.width, image.height), image.get_data(format, pitch))

  1   2   3   4   5   6   7   >