Free Trial
10 days, no credit_card

<< More Tutorials

How to resize an image by width and height in Python 3 using rethumb?

To resize an image or photo in Python 3 use the following code:

from urllib.request import urlopen

param_operation1 = "height"
param_value1 = 100 # New height in pixels.

param_operation2 = "width"
param_value2 = 100 # New width in pixels.

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

response = urlopen("{0}/{1}/{2}/{3}/{4}".format(param_operation1, param_value1, param_operation2, param_value2, 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 resize-by-width-and-height.js

More examples using Python 3