473,734 Members | 2,274 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 4545
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
3030
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
1242
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
2147
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
6260
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
3028
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
5453
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
2008
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
8948
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8780
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9456
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9315
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
9186
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...
1
6742
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
4553
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...
0
4816
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3264
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

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.