Session Ready
Exercise

Proportionally resizing

We want to downscale the images of a veterinary blog website so all of them have the same compressed size.

It's important that you do this proportionally, meaning that these are not distorted.

First, you'll try it out for one image so you know what code to test later in the rest of the pictures.


The image preloaded as dogs_banner.

Remember that by looking at the shape of the image, you can know its width and height.

Instructions
100 XP
  • Import the module and function to resize.
  • Set the proportional height and width so it is half the image's height size.
  • Resize using the calculated proportional height and width.