November 2018
Intermediate to advanced
492 pages
12h 19m
English
In order to increase or decrease the size of an image, we can use the resize() function, which internally up-samples or down-samples the image, respectively. This will be discussed in detail in the next chapter.
Resizing to a larger image
Let us start with a small clock image of a size of 149 x 97 and create a larger size image. The following code snippet shows the small clock image we will start with:
im = Image.open("../images/clock.jpg")print(im.width, im.height)# 107 105im.show()
The output of the previous code, the small clock image, is shown as follows:

The next line of code shows how the resize() function can be used ...
Read now
Unlock full access