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
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
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
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
Thank You! That helped.
Somehow obvious when you pointed out, but...*phew*.
Almad
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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,
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,
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
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
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
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
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
+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
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
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
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
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
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
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
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
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
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
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
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
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
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
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/
--
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
[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
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
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
Someone out there must surely know - please!
Peter
--
http://mail.python.org/mailman/listinfo/python-list
[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
--
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
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)
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
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
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.
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
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
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
. 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
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
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
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
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
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
The error message is -- Syntax error and it highlights the last
else statement.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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) +
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
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
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
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
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
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.
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
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.
--
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
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
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
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
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
[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
[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
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
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
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
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
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
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
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
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
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.
object and turn that into something PIL
can read, though.
Jeremy
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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,
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
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
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
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
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
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
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
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
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
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
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
801 - 900 of 1021 matches
Mail list logo