Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 629 Bytes

how-to-enlarge-image.md

File metadata and controls

27 lines (19 loc) · 629 Bytes

How to enlarge (scale up) an image

from PIL import Image

im = Image.open('/var/www/examples/small.png')
im = im.resize((150, 150))

im.show()
  • PIL - import lib:Pillow package modules
  • Image.open - open given image with Pillow
  • .resize( - resizes given image to the specified size
  • (150, 150) - width and height to enlarge our image to
  • .show() - displays resulting image

Example:

from PIL import Image

im = Image.open('/var/www/examples/small.png')
im = im.resize((150, 150))

im.show()