Sunday 15 August 2010

python resize image without losing sharpness -



python resize image without losing sharpness -

from pil import image import sys image = image.open(sys.argv[1]) basewidth = 1200 img = image wpercent = (basewidth / float(img.size[0])) hsize = int((float(img.size[1]) * float(wpercent))) img = img.resize((basewidth, hsize), image.bicubic) img.save('sompic1.jpg') print "image %s" % (str(img.size))

i want resize 1200xauto , without losing ratio image must maintain shartness etc etc.

but resized images somehow destroyed in sharpness. used antialias also, no change. how possible not lose sharpness?

original image: (600x450)

new 1 (1200x630):

you trying resize image larger size original, normal loose quality.

to resize image smaller size, may have @ module created: python-image-resize

image python-2.7 python-imaging-library

No comments:

Post a Comment