Re: PIL problem with biprocessor hardware

2006-05-26 Thread mardif
OK, this is the code: image is the object instance of Image class which contains all informations pil = Image.open( os.path.join( image.path,image.name ) ) if image.rotation_angle != 2: try: pil = pil.rotate( rotation_levels

Re: PIL problem with biprocessor hardware

2006-05-26 Thread [EMAIL PROTECTED]
I wonder if there are other threads accessing image? Maybe image isn't fully initialized by some other thread before this code accesses it? It's hard to say what's going wrong. I don't believe that an SMP system would have any bearing on an application unless it uses multiple threads of

Re: PIL problem with biprocessor hardware

2006-05-26 Thread [EMAIL PROTECTED]
oops. lost my train of thought. I was gonna say, I wonder if some of these image manipulation routines are using multiple threads? -- http://mail.python.org/mailman/listinfo/python-list

cross-compile PIL

2006-05-17 Thread NicolasP
Hello, I need to compile PIL (python imaging library) package for an ARM based linux system. Does anyone can tell me how to do this ? Thanks Nicolas -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL thumbnails unreasonably large

2006-05-11 Thread Almad
Thank You! That helped. Somehow obvious when you pointed out, but...*phew*. Almad -- http://mail.python.org/mailman/listinfo/python-list

PIL thumbnails unreasonably large

2006-05-10 Thread Almad
Hello, I wonder how do I create reasonable thumbnails from JPEG with PIL. My code: logging.debug('Downloading image %s' % id) uri = ''.join([config['photo']['masterpath'], '?p=', str(id)]) uf = urlopen(uri).read() f = tmpfile() f.write

Re: PIL thumbnails unreasonably large

2006-05-10 Thread Almad
Forgot to add: I'm using PIL 1.1.5 with Python 2.4, expected on both Gentoo Linux and Windows XP. -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL thumbnails unreasonably large

2006-05-10 Thread Larry Bates
Almad wrote: Hello, I wonder how do I create reasonable thumbnails from JPEG with PIL. My code: logging.debug('Downloading image %s' % id) uri = ''.join([config['photo']['masterpath'], '?p=', str(id)]) uf = urlopen(uri).read() f = tmpfile

Re: PIL thumbnails unreasonably large

2006-05-10 Thread Fredrik Lundh
Almad wrote: I wonder how do I create reasonable thumbnails from JPEG with PIL. My code: logging.debug('Downloading image %s' % id) uri = ''.join([config['photo']['masterpath'], '?p=', str(id)]) uf = urlopen(uri).read() f = tmpfile

Re: Anaglyph 3D Stereo Imaging with PIL and numpy

2006-05-03 Thread Scott David Daniels
David Murmann wrote: i just found some colored glass and experimented a bit with these red/green 3d images, so i thought i'd share this simple script i wrote to generate such images with anyone whos interested. i also wouldn't mind some comments on the code. Check out VPython -- there you can

PIL / libjpeg install problem

2006-04-25 Thread mikko . koivunen
Hello all, I am installing the Python Imaging Library (1.1.5). Following the README that came with PIL sources, I ran path/to/python setup.py build_ext -i which informed me that JPEG support is OK. However when I run path/to/python selftest.py from the same package, I get an IOError: decoder jpg

Python + PIL test server.

2006-04-11 Thread Gaz
Hi guys. I installed XAMPP, an easy to set up Apache, Mysql and PHP server. But im trying to get Python work on it so i can test my scripts. The addon for XAMPP is only for Linux, i wonder if you can help me out in installing Python + PIL support. Any tutorial or something? I searched here

PIL question about crop method

2006-04-05 Thread John Salerno
I might be way off target even looking into this method for what I need to do, but I'm still a little confused about the description of it: crop im.crop(box) = image Returns a rectangular region from the current image. The box is a 4-tuple defining the left, upper, right, and lower pixel

Re: PIL question about crop method

2006-04-05 Thread Diez B. Roggisch
John Salerno schrieb: I might be way off target even looking into this method for what I need to do, but I'm still a little confused about the description of it: crop im.crop(box) = image Returns a rectangular region from the current image. The box is a 4-tuple defining the left,

Re: PIL question about crop method

2006-04-05 Thread Gary Herron
John Salerno wrote: I might be way off target even looking into this method for what I need to do, but I'm still a little confused about the description of it: crop im.crop(box) = image Returns a rectangular region from the current image. The box is a 4-tuple defining the left, upper, right,

Re: PIL question about crop method

2006-04-05 Thread John Salerno
Diez B. Roggisch wrote: Alternatively you can see it as boundary lines, in the order left, top, right, bottom. (10, 20, 30, 100) So in the above, from where are the numbers being counted? 10 is ten pixels from the left border of the image? 20 is twenty pixels from the top border? But is

Re: PIL question about crop method

2006-04-05 Thread John Salerno
John Salerno wrote: Diez B. Roggisch wrote: Alternatively you can see it as boundary lines, in the order left, top, right, bottom. (10, 20, 30, 100) So in the above, from where are the numbers being counted? 10 is ten pixels from the left border of the image? 20 is twenty pixels from

Re: PIL question about crop method

2006-04-05 Thread Philippe Martin
Yes John Salerno wrote: John Salerno wrote: Diez B. Roggisch wrote: Alternatively you can see it as boundary lines, in the order left, top, right, bottom. (10, 20, 30, 100) So in the above, from where are the numbers being counted? 10 is ten pixels from the left border of the

Re: PIL question about crop method

2006-04-05 Thread Gary Herron
John Salerno wrote: John Salerno wrote: Diez B. Roggisch wrote: Alternatively you can see it as boundary lines, in the order left, top, right, bottom. (10, 20, 30, 100) So in the above, from where are the numbers being counted? 10 is ten pixels from the left border of the

Re: PIL ImageDraw line not long enough

2006-04-01 Thread Bob Greschke
Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Bob Greschke wrote: I have to extend the vertical line to y+8, instead of y+7 to get the line segment to be drawn long enough. This is on Linux, Solaris, 2.x versions of Python, 1.1.5 version of PIL, and on Windows

PIL ImageDraw line not long enough

2006-03-30 Thread Bob Greschke
+5,y), Color) Graph.line((x+3,y, x+3,y+8), Color) I have to extend the vertical line to y+8, instead of y+7 to get the line segment to be drawn long enough. This is on Linux, Solaris, 2.x versions of Python, 1.1.5 version of PIL, and on Windows with the latest of everything. Am I missing

Re: PIL ImageDraw line not long enough

2006-03-30 Thread nikie
Graph.line((x+1,y, x+5,y), Color) Graph.line((x+3,y, x+3,y+8), Color) I have to extend the vertical line to y+8, instead of y+7 to get the line segment to be drawn long enough. This is on Linux, Solaris, 2.x versions of Python, 1.1.5 version of PIL, and on Windows with the latest

Re: PIL ImageDraw line not long enough

2006-03-30 Thread Fredrik Lundh
Bob Greschke wrote: I have to extend the vertical line to y+8, instead of y+7 to get the line segment to be drawn long enough. This is on Linux, Solaris, 2.x versions of Python, 1.1.5 version of PIL, and on Windows with the latest of everything. Am I missing a setting somewhere? I recently

Re: PIL image size reduction script

2006-03-27 Thread Philippe Martin
the image to a certain file size. Maybe you should try optimizing the additional save parameters for the jpeg encoder. (http://www.pythonware.com/library/pil/handbook/formats.htm). Try reducing the quality parameter. l_image.save(l_tmp_file_name, quality=25) That might be it !!! Thanks

Re: PIL image size reduction script

2006-03-27 Thread Philippe Martin
want to compress the image to a certain file size. Maybe you should try optimizing the additional save parameters for the jpeg encoder. (http://www.pythonware.com/library/pil/handbook/formats.htm). Try reducing the quality parameter. l_image.save(l_tmp_file_name, quality=25) Hope this helps

Re: PIL image size reduction script

2006-03-27 Thread nikie
Philippe Martin wrote: PS: where can I find those extra parameters in the doc (ex: quality) ... I must be blind. In the http://www.pythonware.com/library/pil/handbook/formats.htm page. Look in the JPEG section. Different file formats support different options. -- http://mail.python.org/mailman

Re: PIL image size reduction script

2006-03-27 Thread Philippe Martin
Many thanks nikie wrote: Philippe Martin wrote: PS: where can I find those extra parameters in the doc (ex: quality) ... I must be blind. In the http://www.pythonware.com/library/pil/handbook/formats.htm page. Look in the JPEG section. Different file formats support different options

PIL image size reduction script

2006-03-26 Thread Philippe Martin
Hi, Thanks to the NG, I got the script hereunder working. 1) I am not certain that the call to convert does much (checking the doc) 2) Can this be improved as far as the final image size in (X,Y) ? For instance, passing a large .jpg with a target byte size of 7000, I get final (X,Y) results

Re: PIL image size reduction script

2006-03-26 Thread nikie
encoder. (http://www.pythonware.com/library/pil/handbook/formats.htm). Try reducing the quality parameter. l_image.save(l_tmp_file_name, quality=25) Hope this helps. Niki -- http://mail.python.org/mailman/listinfo/python-list

PIL: Breaking/Wrapping lines automatically

2006-03-23 Thread Jorge Godoy
Hi! Is there something I can do in PIL to restrict a line to a certain size and have it to break/wrap into a newline automatically? (Or by using some code, of course...) I'm trying to add information to barcodes and since the label space is fixed I'd like to use all the horizontal space I can

PIL and PSDraw

2006-03-01 Thread Sybren Stuvel
Hi there, I'm experimenting with PIL to create a PostScript file. The end result should be an EPS file with a couple of bar graphs. At this moment, I have a very simple piece of code: ps = PIL.PSDraw.PSDraw(file('demo.ps', 'w')) ps.begin_document() ps.rectangle((0, 0, 650, 150

Re: PIL and PSDraw

2006-03-01 Thread Kjell Magne Fauske
PIL is, as far as i know,primarily a tool for creating and manipulating raster graphics. If you want to create eps vector graphics with Python I recommend PyX: http://pyx.sourceforge.net/ Take a look at the examples to see some of the possibilities: http://pyx.sourceforge.net/examples/index.html

Re: PIL and PSDraw

2006-03-01 Thread Sybren Stuvel
Kjell Magne Fauske enlightened us with: PIL is, as far as i know,primarily a tool for creating and manipulating raster graphics. I was afraid of that. If you want to create eps vector graphics with Python I recommend PyX: That looks exactly what I was looking for. Thanks a lot! Sybren

Re: Unable to get PIL to load jpeg images

2006-02-15 Thread gr
broken build interfered with the linking of PIL to the libraries. I went for overkill, and deleted all the PIL installation and site-packages directories, then reinstalled from the original tarball. This gave a curious glitch, in that the first time I ran it it failed to load Tkinter with some

Re: Unable to get PIL to load jpeg images

2006-02-15 Thread gr
Found it...and will share. You need to install the X Software Developement library (standard only is enough) from you Fedora distro...not sure what will be required on other Linux distro's. Worked like a charm...thanks Peter. gerry rodman http://www.gerryrodman.com/ --

Re: Unable to get PIL to load jpeg images

2006-02-09 Thread peter . mosley
to also install a jpeg development library, which fortunately was available on my Fedora Core 3 installation disc. A final glitch was that the previous broken build interfered with the linking of PIL to the libraries. I went for overkill, and deleted all the PIL installation and site-packages

Re: Unable to get PIL to load jpeg images

2006-02-09 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: The problem was that I didn't have the right jpeg library installed (although what I had was enough to show jpegs in gThumb, GIMP and the Gnome and KDE desktops so I don't understand why it wasn't). I had to also install a jpeg development library, which

Re: Unable to get PIL to load jpeg images

2006-02-08 Thread Andrew Gwozdziewycz
On 2/7/06, Steve Holden [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Someone out there must surely know - please! Peter Try building the PIL from scratch. It might give you some insight as to which library it exactly is looking for. I can remember when compiling the PIL on my mac

Re: Unable to get PIL to load jpeg images

2006-02-08 Thread Amit Khemka
This is because PIL, is not able to find the jpeg library . 1. Install jpeg-libs from sources: (http://www.ijg.org/files/jpegsrc.v6b.tar.gz) 2.0: clean the PIL build 2.1 In setup.py that comes with PIL, set the JPEG_ROOT to the jpeg-lib path 3.0 run setup.py I hope that should help .. cheers

Re: Unable to get PIL to load jpeg images

2006-02-07 Thread peter . mosley
Someone out there must surely know - please! Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Unable to get PIL to load jpeg images

2006-02-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: Someone out there must surely know - please! Peter Try image-sig@python.org - or better still, subscribe to the image SIG mailing list (then you'll see replies ...) I've never had any problems loading JPEG images. It's probably a setup issue. regards Steve --

Unable to get PIL to load jpeg images

2006-02-06 Thread peter . mosley
Hello again I'm still wrestling with Python / Tkinter / PIL. I have almost got it to work - on a Fedora Core 1 system I can now display images in a Tkinter window. But I also run a Fedora Core 3 system, and when I tried the same procedures I get the following errors:- [EMAIL PROTECTED] jpgTest

PIL and transparent GIFs

2006-02-01 Thread toto
Hi, Does anybody know how to save an image in GIF format preserving transparent background ?? Here's what I tested : import Image, ImageDraw im = Image.open('/path/to/model.gif') # An image with transparent backgroung draw = ImageDraw.Draw(im)

Re: PIL and transparent GIFs

2006-02-01 Thread Kamilche
It can only read transparency, it can't write it. I went looking and found that out a couple weeks ago. -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL and transparent GIFs

2006-02-01 Thread Terry Hancock
On 1 Feb 2006 14:41:05 -0800 Kamilche [EMAIL PROTECTED] wrote: It can only read transparency, it can't write it. I went looking and found that out a couple weeks ago. There was a patch published at one time that was supposed to fix this. I remember doing some testing and not finding it to work

Re: PIL and transparent GIFs

2006-02-01 Thread Fredrik Lundh
Terry Hancock wrote: There was a patch published at one time that was supposed to fix this. I remember doing some testing and not finding it to work perfectly, but I may have been doing something wrong. Can't recover it at the moment, but some search engine work might turn it up.

Re: Dominant color PIL

2006-01-24 Thread Fredrik Lundh
Sebastjan Trepca wrote: I was wondering is it possible to find out which colour is dominant in an image using PIL? It would be very easy to create interesting mozaic images with that :) some alternatives: i = Image.open(...) i.quantize(1).convert(RGB).getpixel((0, 0)) (208, 205, 202

Re: Dominant color PIL

2006-01-23 Thread Rinzwind
by this method is an internal PIL data type, which only supports certain sequence operations. To convert it to an ordinary sequence (e.g. for printing), use list(im.getdata()). So you could get them and count them in :) Don't know if you should do that on a 1600x1200 wallpaper tho :D Wim Terry Hancock

Re: Dominant color PIL

2006-01-23 Thread Terry Hancock
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. To convert it to an ordinary sequence (e.g. for printing), use list(im.getdata()). So you could get them and count them in :) Don't

Re: Dominant color PIL

2006-01-23 Thread Sebastjan Trepca
. 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. To convert it to an ordinary sequence (e.g

Dominant color PIL

2006-01-22 Thread Sebastjan Trepca
Hi!I was wondering is it possible to find out which colour is dominant in an image using PIL? It would be very easy to create interesting mozaic images with that :)Thanks, Sebastjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Dominant color PIL

2006-01-22 Thread Terry Hancock
On Sun, 22 Jan 2006 21:07:45 +0100 Sebastjan Trepca [EMAIL PROTECTED] wrote: I was wondering is it possible to find out which colour is dominant in an image using PIL? It would be very easy to create interesting mozaic images with that :) Shrink it to one pixel, and get that pixel's value

Re: Retrieve a GIF's palette entries using Python Imaging Library (PIL)

2006-01-19 Thread and-google
Stuart wrote: I see that the 'Image' class has a 'palette' attribute which returns an object of type 'ImagePalette'. However, the documentation is a bit lacking regarding how to maniuplate the ImagePalette class to retrieve the palette entries' RGB values. ImagePalette.getdata() should do

Retrieve a GIF's palette entries using Python Imaging Library (PIL)

2006-01-13 Thread Stuart
I am using the Python Imaging Library (PIL) to process GIF images. I need to be able to retrieve the RGB values for each color palette entry. I see that the 'Image' class has a 'palette' attribute which returns an object of type 'ImagePalette'. However, the documentation is a bit lacking

Re: PIL implementation

2006-01-10 Thread Peter Hansen
arkestra wrote: The error message is -- Syntax error and it highlights the last else statement. You've got incorrect indentation, at least judging by what I see in my newsreader (Thunderbird), which clearly shows the else indented more than the corresponding if. Next time, please cut and

Re: PIL implementation

2006-01-09 Thread arkestra
The error message is -- Syntax error and it highlights the last else statement. -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL implementation

2006-01-09 Thread arkestra
The error message is -- Syntax error and it highlights the last else statement. thanks for the reply. -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL implementation

2006-01-07 Thread Claudio Grondi
circusdei wrote: I wrote this snippet with the intention of -- capturing a section of the screen whenever it changes. It could be implemented to log any sort of messaging system ( by saving consecutive images eg. 1.png...etc). #code import Image import ImageGrab

PIL implementation

2006-01-06 Thread circusdei
I wrote this snippet with the intention of -- capturing a section of the screen whenever it changes. It could be implemented to log any sort of messaging system ( by saving consecutive images eg. 1.png...etc). #code import Image import ImageGrab lastchatbound = (21, 504) +

Re: PIL and ImageMagick scalability

2005-12-27 Thread Fredrik Lundh
Sebastjan Trepca wrote: I have a question about image processing. We have a website which will process a lot of images a day.It will be running Apache(worker) with mod_python. My question is what should we use for processing. If we use PIL the processing will be done with the same process

PIL and ImageMagick scalability

2005-12-26 Thread Sebastjan Trepca
Hi everyone! I have a question about image processing. We have a website which will process a lot of images a day.It will be running Apache(worker) with mod_python. My question is what should we use for processing. If we use PIL the processing will be done with the same process that handles other

Resizing of PIL images

2005-12-21 Thread Tuvas
I am seeking a way to resize a PIL image, even if the original is a smaller dimention than the new size. Resizing seems to only make an image smaller, and not larger. I have a 700x700 sized picture, sometimes that will display an image larger and other times smaller. Is there an easy way to do

Re: Resizing of PIL images

2005-12-21 Thread Fredrik Lundh
Tuvas wrote: I am seeking a way to resize a PIL image, even if the original is a smaller dimention than the new size. Resizing seems to only make an image smaller, and not larger. I have a 700x700 sized picture, sometimes that will display an image larger and other times smaller

Re: Resizing of PIL images

2005-12-21 Thread Peter Hansen
Tuvas wrote: I am seeking a way to resize a PIL image, even if the original is a smaller dimention than the new size. Resizing seems to only make an image smaller, and not larger. I have a 700x700 sized picture, sometimes that will display an image larger and other times smaller

Re: Resizing of PIL images

2005-12-21 Thread Fredrik Lundh
Peter Hansen wrote: See the docs on transform(). From the sounds of it, if resize() won't stretch something (it's own docs don't make that clear) resize resizes the image to the given size. thumbnail (which is an in-place operation) doesn't; it creates an image no larger than the given size.

Re: Resizing of PIL images

2005-12-21 Thread Peter Hansen
Fredrik Lundh wrote: Peter Hansen wrote: See the docs on transform(). From the sounds of it, if resize() won't stretch something (it's own docs don't make that clear) resize resizes the image to the given size. thumbnail (which is an in-place operation) doesn't; it creates an image no

Re: Resizing of PIL images

2005-12-21 Thread Tuvas
I used thumbnail originally, and am using resize now. Perhaps it has to do with the image type (That is based on strings), but the resize function just didn't do it for me. No idea why... Oh well, probably just a problem for me, but, I've found a way around it, for the time being. --

ANN: PIL 1.1.6 alpha 1 (december 11, 2005)

2005-12-12 Thread Fredrik Lundh
The first official PIL 1.1.6 alpha is now available from effbot.org: http://effbot.org/downloads (look for Imaging-1.1.6a1.tar.gz) Notable additions since 1.1.5: + Added pixel access object. The load method now returns an access object that can be used to directly get and set pixel

Re: JPEG decoder not available in PIL

2005-12-08 Thread Paul Dickson
On 6 Dec 2005 14:02:37 -0800, Peter wrote: I have a problem which seems to come up from time to time but I can't find anything relevant in the archives. I have used PIL v1.1.5 with no problem on Windows for some time but now wish to put it on Linux (Suse Linux v10.0). I obtained and built

JPEG decoder not available in PIL

2005-12-06 Thread Peter
I have a problem which seems to come up from time to time but I can't find anything relevant in the archives. I have used PIL v1.1.5 with no problem on Windows for some time but now wish to put it on Linux (Suse Linux v10.0). I obtained and built the JPEG libraries (jpeg-6b) without any problem

Re: JPEG decoder not available in PIL

2005-12-06 Thread Heiko Wundram
loader cache finds the system library first, so although you included the specifications for the library you installed to /usr/local, you link against the system library which might be different (in this case it is not and for jpeglib will never be, but nevertheless, this is an absolute NONO). PIL

Re: JPEG decoder not available in PIL

2005-12-06 Thread Fredrik Lundh
Peter wrote: At the last moment I managed to solve this problem and I hope it is worth supplying the details here. First there is a file in the install directory libImaging/Jpeg.h which has a line: #include jpeglib.h but there is no such header file. On my system I put: #include

Re: Stealing focus: PIL

2005-11-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I'm using the Python Image Library (PIL) for Python 2.4. If I have an image and I show it from PIL import Image im = Image.new('RGB',100,100) im.show() then the output window steals focus. It's very handy to use an image to show the progress of execution

Re: Stealing focus: emacs, and PIL, in Windows

2005-11-26 Thread Graham Fawcett
[EMAIL PROTECTED] wrote: I'm using GNU Emacs 21.3.1 with python-mode 1.0alpha under Windows XP. Whenever I execute a command in an edit window (with py-execute-region), the output window steals the focus. How can I stop this happening? [snip] I commented out the command (pop-to-buffer

Stealing focus: emacs, and PIL, in Windows

2005-11-25 Thread damonwischik
I'm using GNU Emacs 21.3.1 with python-mode 1.0alpha under Windows XP. Whenever I execute a command in an edit window (with py-execute-region), the output window steals the focus. How can I stop this happening? I don't know any lisp, but I hacked together this routine so that that when I press

Stealing focus: PIL

2005-11-25 Thread damonwischik
I'm using the Python Image Library (PIL) for Python 2.4. If I have an image and I show it from PIL import Image im = Image.new('RGB',100,100) im.show() then the output window steals focus. It's very handy to use an image to show the progress of execution for my program, but the computer

Re: Simple photo collage using Python and PIL

2005-11-23 Thread Fredrik Lundh
to get me started please - it feels like it's probably just a few lines of code for an expert (no validation required - i'll be the only one using it) any help much appreciated. the three first sections in the PIL handbook discusses how to create, load, save, and cut/paste images. here's

Re: Simple photo collage using Python and PIL

2005-11-23 Thread Thomas Guettler
format. You don't need PIL to parse it. Read the file into memory. You could use a matrix: pic[0][0] first pixel pic[-1][-1] last pixel Then you coping or changing pixels is easy: for x in xrange(?, ?): for y in xrange(?, ?): ... At the end create png from pnm with convert. I hope

Re: Simple photo collage using Python and PIL

2005-11-23 Thread Callum Prentice
Thank you Thomas - I've heard good things about Image Magick - I'll go read up on it. Cheers. Cal. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple photo collage using Python and PIL

2005-11-23 Thread Callum Prentice
Thanks very much Fredrik - just what I was looking for - that gives me a good place to start from. Much appreciated. Cal. -- http://mail.python.org/mailman/listinfo/python-list

PIL FITs image decoder

2005-11-22 Thread jbrewer
I'm trying to read in a FITs image file for my research, and I decided that writing a file decoder for the Python imaging library would be the easiest way to accomplish this for my needs. FITs is a raw data format used in astronomy. Anyway, I followed the example in the PIL documentation online

Re: PIL FITs image decoder

2005-11-22 Thread Fredrik Lundh
jbrewer wrote: I'm trying to read in a FITs image file for my research, and I decided that writing a file decoder for the Python imaging library would be the easiest way to accomplish this for my needs. FITs is a raw data format used in astronomy. Anyway, I followed the example in the PIL

Re: PIL FITs image decoder

2005-11-22 Thread Robert Kern
jbrewer wrote: I'm trying to read in a FITs image file for my research, and I decided that writing a file decoder for the Python imaging library would be the easiest way to accomplish this for my needs. FITs is a raw data format used in astronomy.

Re: PIL FITs image decoder

2005-11-22 Thread jbrewer
object and turn that into something PIL can read, though. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL FITs image decoder

2005-11-22 Thread Robert Kern
the data into a numarray object and turn that into something PIL can read, though. If you can bear having two copies in memory, Image.frombuffer() generally does the trick. -- Robert Kern [EMAIL PROTECTED] In the fields of hell where the grass grows high Are the graves of dreams allowed to die

Re: PIL FITs image decoder

2005-11-22 Thread jbrewer
If you can bear having two copies in memory, Image.frombuffer() generally does the trick. What arguments do you pass to this function, and do you flatten the array from the FITs image? I this but got garbage out for the image. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL FITs image decoder

2005-11-22 Thread jbrewer
If you can bear having two copies in memory, Image.frombuffer() generally does the trick. Also, does PIL have a contrast / scale option that is similar to zscale in ds9 or equalize in Image Magick? Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL FITs image decoder

2005-11-22 Thread Robert Kern
jbrewer wrote: [I wrote:] If you can bear having two copies in memory, Image.frombuffer() generally does the trick. What arguments do you pass to this function, and do you flatten the array from the FITs image? I this but got garbage out for the image. The array would have to be

Simple photo collage using Python and PIL

2005-11-22 Thread Callum Prentice
i need a script that i can use locally as well as online that will: * create a large (maybe something like 2k x 2k) master image in memory * open a text file and read all the lines from it (maybe 1000 lines max) * each line is composed of an x, y, name and a png image filename * for each line,

Re: PIL FITs image decoder

2005-11-22 Thread jbrewer
I tried following your simple example (I already had something similar) but with no luck. I'm completely stumped as to why this doesn't work. I even tried manually scaling the data to be in the range 0-255 out of desperation. The data is definitely contiguous and 32 bit floating point. At this

PIL- error message- cannot open libtiff.so.3

2005-11-11 Thread Tuvas
Okay, so I've been getting this error message when trying to use PIL to open a JPEG, that there isn't a library by the name of libtiff.so.3 . I've been searching the documentation, there isn't any reference to this library. Also, I don't know why it's doing this as I'm trying to open a JPEG

Re: PIL- error message- cannot open libtiff.so.3

2005-11-11 Thread Fredrik Lundh
Tuvas wrote: Okay, so I've been getting this error message when trying to use PIL to open a JPEG, that there isn't a library by the name of libtiff.so.3 . I've been searching the documentation, there isn't any reference to this library. Also, I don't know why it's doing this as I'm trying

Re: PIL- error message- cannot open libtiff.so.3

2005-11-11 Thread Tuvas
I got it from the PIL website, version 1.1.5. I guess it's possible that there's another library Image on the computer that it could be confusing? I'm looking for new things. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL- error message- cannot open libtiff.so.3

2005-11-11 Thread Erik Max Francis
Tuvas wrote: Okay, so I've been getting this error message when trying to use PIL to open a JPEG, that there isn't a library by the name of libtiff.so.3 . I've been searching the documentation, there isn't any reference to this library. Also, I don't know why it's doing this as I'm trying

Re: PIL- error message- cannot open libtiff.so.3

2005-11-11 Thread Fredrik Lundh
Tuvas wrote: I got it from the PIL website, version 1.1.5. I guess it's possible that there's another library Image on the computer that it could be confusing? I'm looking for new things. Thanks! afaik, there are no unix binaries on the PIL website. did you build it yourself, from source

Re: PIL- error message- cannot open libtiff.so.3

2005-11-11 Thread Tuvas
Oddly enough, that seems to have solved the problem. Duh. Take the simple solution first. Thanks for the wake up call! -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL- error message- cannot open libtiff.so.3

2005-11-11 Thread Fredrik Lundh
Erik Max Francis wrote: Install libtiff. note that PIL doesn't use libtiff, so that only addresses the symtoms. (which might be good enough, of course) /F -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL- error message- cannot open libtiff.so.3

2005-11-11 Thread Tuvas
Well, it seems to have resolved the problem. Don't know what was causing it to begin with, but I'll take it... -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL- Tkinter

2005-11-09 Thread Fredrik Lundh
Tuvas [EMAIL PROTECTED] wrote Is there a way to put an image loaded from PIL into a TKinter GUI? Without converting the image to a .bmp, and using a canvas? If that's the only way it'll work, I'll take it, but... It would be nice otherwise... hmm. is google down today? here's a random

Re: PIL- Tkinter

2005-11-09 Thread Kevin Walzer
Tuvas wrote: Is there a way to put an image loaded from PIL into a TKinter GUI? Without converting the image to a .bmp, and using a canvas? If that's the only way it'll work, I'll take it, but... It would be nice otherwise... Can you use PIL to convert it to a GIF? Tk can display GIF's

<    4   5   6   7   8   9   10   11   >