473,756 Members | 9,160 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Image Manipulation

Can anyone recommend the easiest way of generating thumbnail images using a
Python library? I've seen that the Python Image Library (PIL) seems to do
this but it isn't installed on my available systems. I'd prefer to use
something distributed with Python, if possible, but will install the library
that makes this functionality easy as a second choice.

Thanks!
Scott

--
Remove .nospam from my e-mail address to mail me.

http://www.e-scott.net
Jul 18 '05 #1
2 4547
Scott Brady Drummonds wrote:
Can anyone recommend the easiest way of generating thumbnail images using a
Python library? I've seen that the Python Image Library (PIL) seems to do
this but it isn't installed on my available systems. I'd prefer to use
something distributed with Python, if possible, but will install the library
that makes this functionality easy as a second choice.


i'm not aware of python built-in functions to resize images,
but with PIL is dead easy to make thumbnails, check:

from "Python is Kung-Fu for the Web":
<http://blog.mans.de/archives/2004/03/28/python-is-kung-fu-for-the-web/>

import Image
im = Image.open(file name)
im.thumbnail((2 00, 200), Image.ANTIALIAS )
im.save(thumbna il, "JPEG", quality = 80, optimize = 1)

you can also feed to open() a file(-like) object, instead
of a filename.

HTH,
deelan.
Jul 18 '05 #2
"Scott Brady Drummonds" <sc************ **********@inte l.com> wrote in message news:<cg******* ***@news01.inte l.com>...
Can anyone recommend the easiest way of generating thumbnail images using a
Python library? I've seen that the Python Image Library (PIL) seems to do
this but it isn't installed on my available systems. I'd prefer to use
something distributed with Python, if possible, but will install the library
that makes this functionality easy as a second choice.

Thanks!
Scott


The easiest way is using PIL. There is sample code in the PIL
documentation that you can use directly.
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5442
by: Rune Johansen | last post by:
Hi. I'm doing some image manipulation in an applet using the example code on this page: http://www.akop.org/art/pixels3.htm However, I really want an application rather than an applet, I just can't figure out how to do the image loading and manipulation when it's not from inside an applet. Any hints on the subject are appreciated.
1
3031
by: Kenneth McDonald | last post by:
Warning: this post may display my utter ignorance of image file format facts. As part of a photo album program I'm working on, I'd like to be able to work with the metadata in JPEG files, which I understand are really JFIF files holding jpg data. Do any Python modules permit me to do this? I looked at PIL, but it seemed to operatre at a higher level, i.e. hiding the file-level implementation details. At the least I'd like to be able...
0
1243
by: Stewart Midwinter | last post by:
I would like to do some image / map manipulation with Python. I've got a very large map file in .png format. My thought is to chop it up into small tiles using some method. What Python module would be helpful for this? Next, when I obtain the start and end co-ordinates of a user's trip, I'd like to stitch together the approriate tiles and present the images that show the terrain the user has travelled over.
9
2151
by: Job | last post by:
Hi, I would like to find out what ASP/ASP.net can do with image manipulation. Does ASP have built in functions (eg. after upload to server) to manipulate images, like rotate, scale, crop etc.? Or are 3rd party solutions needed to do this? I am a php/codfusion programmer and know nothing about asp, so I'm hoping somebody here can help me out.
3
6261
by: David | last post by:
I would like to display a JPEG image from Python on a Windows machine. I Googled 'python jpeg display' and have not found what I am looking for, which is code I can call directly and pass the image. I see the PIL library lets me do all sorts of image manipulation, but is there a convenient way to display results? I guess I could issue shell commands to a graphics display package such as IrfanView, but I thought there might be a cleaner...
9
3377
by: zacariaz | last post by:
I dont know, and i dont much like javascript, however, i am told that the only way to do want i want to do, is with javascript, so here goes. zoom and cut is the only features i need. 1. the image that need manipulating is places on the server. dont need js for that ;-) 2. the client has the oppotunity to manipulate the image. cut and zoom. 3. the image i saved on the server.
14
3030
by: nicolasg | last post by:
Hi folks, I have accomplished to make a python program that make some image manipulation to bmp files. I now want to provide this program as a web service. A user can visit a site and through a web interface he should upload the file to the web server , the server then will do the image process with the python program I have wrote and when it finish the user must get the image file back . My question is how difficult is to set up a web...
42
5457
by: John Doty | last post by:
I realized that I have a little job on the table that is a fine test of the Python versus Standard Forth code availability and reusability issue. Note that I have little experience with either Python or Standard Forth (but I have much experience with a very nonstandard Forth). I've noodled around a bit with both gforth and Python, but I've never done a serious application in either. In my heart, I'm more of a Forth fan: Python is a bit...
8
2013
by: shotokan99 | last post by:
i have this situation. i have a query string: http://www.myquerystring.com?x=xxxxx what this url does is it will return or start downloading a .png file. what i wanted to do is trap this png file and manipuate the image like resizing, color...etc. how can i do this?
0
9901
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9728
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8733
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7282
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6551
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3827
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3392
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2694
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.