简体   繁体   中英

Resample the Image Pixels in Python

I have an image of 300*300 pixels size and want to convert it into 1500*1500 pixels size using python. I need this because i have to georeferenced this image with 1500*1500 pixel raster image. Any python library function or basic fundamental how to do this are welcome.

You should try using Pillow (fork of PIL = Python Image Library)

Simple like this:

from PIL import Image
img = Image.open("my_image.png")
img.resize((1500, 1500, ))
img.save("new_image.png")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM