• Advertisement
Sign in to follow this  

Manipulating Image

This topic is 4840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to manipulate a image, i have a image *.jpg with 500x350 of dimenssions. I like to do with functions or routines that can make a new image with 100x100 and save into disk. I don´t want to use some programs(that i need to pay) that can be find at a search in google. If someone knows tutorials or something that can help me i will me greatfull with you. Tank you to read my post.

Share this post


Link to post
Share on other sites
Advertisement
Im not sure about tutorials, but it shouldn't be hard to write yourself, Just get a group of pixels in large pic to represent a single pixel in smaller pic. Take an average of the groups colour values and use that value for the pixel in the small pic.

Thats how Id go about it anyway.

Share this post


Link to post
Share on other sites

from PIL import Image
import os

filename = "my_image.bmp"
image = Image.open(filename)
image.thumbnail((100, 100), Image.ANTIALIAS)
newName = "tn" + os.path.splitext(filename)[0] + ".jpg"
image.save(newName)
image.close()

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement