Is it possible to change a picture resolution with Python?
maxerickson at gmail.com
Thu Sep 21 00:52:29 CEST 2006
"Lad" <python at hope.cz> wrote:
>> This is some example code:
>> from PIL import Image
>> im = Image.open("1.jpg")
>> nx, ny = im.size
>> im2 = im.resize((int(nx*1.5), int(ny*1.5)), Image.BICUBIC)
> Thank you for your reply.
> But the above code increases size only , but not DPI resolutions(
> vertical nad horizontal).I need a higher vertical and horisontal
> Any idea how to do that?
> Thank you
If you just want to change the dpi flag that some software uses to
interpret the size of the image when rendering it, something like:
might work. You can get lots of info on why this doesn't really change
the resolution of the image from google.
More information about the Python-list