Free Trial
10 days, no credit_card

<< More Tutorials

How to resize an image to cover any dimensions in Python 3 using rethumb?

To resize an image, with our "cover" operation, in Python 3 use the following code:

from urllib.request import urlopen

param_operation = "cover"
param_value = "150x200" # New WIDTHxHEIGHT in pixels.

image_url = ""
image_filename = "resized-image.jpg"

response = urlopen("{0}/{1}/{2}".format(param_operation, param_value, image_url))
fh = open(image_filename, "wb")

Start using this example now

Use the following commands to get started:

$ git clone
$ cd rethumb-python3-examples
$ python3 cover.js

More examples using Python 3