| Author |
Message |
Cerulean Gokenin
Joined: 22 Oct 2004 Posts: 742 Location: London, England
|
Posted: Sat Oct 23, 2004 6:30 pm Post subject: PIL - Python Imaging Library |
|
|
And what a great library it is! High level API, letting you add text to images, convert to text to image, rotate images, resize images on the fly, draw over an image, invert images, plus many more. Can handle jpg, png (and I think GIF).
I had a small problem compiling it (freetype error), but just including the file the compiler says is missing solves it.
For example, to take an image and rotate it by 40 degrees:
| Code: | #!/usr/bin/python
import Image
img = Image.open("someimage.jpg")
img = img.rotate(40)
img.save("somerotatedimage.jpg", "JPEG")
|
And thats it. Very cool. |
|
| Back to top |
|
 |
Algorithms Dragon
Joined: 21 Oct 2004 Posts: 343 Location: Florida
|
Posted: Sun Oct 24, 2004 5:52 am Post subject: |
|
|
| Can handle JPEG, GIF, PNG, TIFF, BMP. There are also thrid party extensions allowing it to handle other formats. Also I don't know if this is web development reference. It might skews people idea of the library. It is mostly used in desktop applications. Not so much web based. *shrug* |
|
| Back to top |
|
 |
Cerulean Gokenin
Joined: 22 Oct 2004 Posts: 742 Location: London, England
|
Posted: Sun Oct 24, 2004 6:22 am Post subject: |
|
|
I'd use it mainly for web things - auto generating thumnails, serving up random images, providing image manipulation tasks.
Plus there's no Python reference. |
|
| Back to top |
|
 |
Algorithms Dragon
Joined: 21 Oct 2004 Posts: 343 Location: Florida
|
Posted: Sun Oct 24, 2004 6:26 am Post subject: |
|
|
| All the real-world applications using PIL I have seen posted on the Python Mailing lists or in c.l.python have been using PIL in a client application setting. It is not widely used on the web as support for more web gear tasks as only recently been added. |
|
| Back to top |
|
 |
|