Python - Scaling image using pgmagick Last Updated : 10 Oct, 2022 Comments Improve Suggest changes Like Article Like Report 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. In this article we will learn how we can perform scaling using pgmagick in python. Code : Python3 # importing library from pgmagick.api import Image img = Image('gog.png') # scaling image img.scale((150, 100), 'lanczos') img.write('scale_gog.png') Input Image: Output: Scaling JPEG image - JPEG Stands for Joint Photographic Experts Group. Due to high number color support upto 2^24 i.e. 16, 777, 216 this is used in commonly every digital camera. And support varying levels of compression. Python3 # importing library from pgmagick import Image, Blob img = Image(Blob(open('koala.jpeg').read())) # scaling image img.scale('250x200') img.write('scale_koala.jpeg') Input Image: Output: Comment More infoAdvertise with us Next Article Python - Scaling image using pgmagick R RahulSabharwal Follow Improve Article Tags : Python Python-pgmagick Practice Tags : python Similar Reads Image Resizing using OpenCV | Python Image resizing refers to the scaling of images. Scaling comes in handy in many image processing as well as machine learning applications. It helps in reducing the number of pixels from an image and that has several advantages e.g. It can reduce the time of training of a neural network as the more th 3 min read Pgmagick sharpen() method - Python The sharpen() function is an inbuilt function in the Pgmagick library that is used to sharpen the image. It uses a Gaussian operator of the given radius and standard deviation (sigma). Syntax: sharpen( radius, sd ) Parameters: This function accept two parameters as mentioned above and described belo 2 min read Pgmagick solarize() method - Python The solarize() function is an inbuilt function in the Pgmagick library that is used to negate all pixels above the threshold level. The function returns the true value on success. Syntax: solarize(thresholdLevel) Parameters: This function accepts a single parameter thresholdlevel which is used to sp 1 min read Pgmagick shear() method - Python The shear() function is an inbuilt function in the Pgmagick library which is used to slide one edge of an image along the X or Y axis to create a parallelogram. The X-direction shear slides an edge along the X-axis, while a Y direction shear slides an edge along the Y-axis. The shear angle is used t 2 min read Pgmagick resize() method - Python The resize() function is an inbuilt function in the Pgmagick library which is used to resize an image. The function returns the true value on success. Syntax: resize('widthxheight') Parameters: This function accepts the string of width and height formatted as 'widthxheight' which depicts the dimensi 1 min read Like