Python – Scaling image using pgmagick

Scaling is the process of resizing an image. We deal with the dimensions of an image. Scaling down deals with making image smaller while Scaling up refers to increase the size of image. Scaling is a very important process in image manipulation because sometimes we get image size smaller than expected and sometimes it is very large. So, in order to make image of perfect size to use Scaling is performed. 
Python3
# importing libraryfrom pgmagick.api import Imageimg = Image('gog.png')# scaling imageimg.scale((150, 100), 'lanczos')img.write('scale_gog.png') |
Input Image: 

Python3
# importing libraryfrom pgmagick import Image, Blobimg = Image(Blob(open('koala.jpeg').read()))# scaling imageimg.scale('250x200')img.write('scale_koala.jpeg') |
Input Image: 



