Monday, April 30, 2012

Resize screenshot with PIL python module .

The script that I've created is made ​​to shrink images. Some screenshots are large and should be resized to be used later on the Internet. It is a simple example that uses PIL module. This script reads the image name that I want to resize and filename that will be saved image. I use python PIL functions how to create a new image.
This python script read the name of image and will create a new image with the given width and height.

$ python 
filename input image:test.png
filename output image:test-out.jpg
import os 
import sys
from PIL import Image 
from PIL import ImageDraw
filnaminp=raw_input("filename input image:")
filnamout=raw_input("filename output image:")

No comments:

Post a Comment