This short tutorial shows how to Python REST developers can change the size of an image — for example a JPG file or a PNG file — using the Aspose.Imaging Cloud SDK for Python. You will learn to build an image‑resizer service with the Python SDK, covering all required properties and methods.
Prerequisite
- Create an account and obtain API credentials to change image size.
- Download the Aspose.Imaging Cloud SDK for Python from the official repository.
- Set up a Python project and add the SDK as a dependency.
Steps to Change Size of Pic Online with Python Low Code API
- Instantiate an ImagingApi object by providing the client ID, client secret, and Cloud endpoint.
- Upload the source image to Cloud storage; this is the image whose size will be changed.
- Define the resize parameters by specifying the output image width, height, and format.
- Create and execute a
ResizeImageRequestusing the[ResizeImage()](https://reference.aspose.cloud/imaging/#/Resize/ResizeImage)method. - Download the resized image from Cloud storage and save it to the local disk.
These steps outline how to decrease picture size with the Python Low Code API: start by initializing the API client, upload the input image, set the desired dimensions, run the resize request, and finally store the resulting file locally.
Code for Image Resizer with Python RESTful Service
The sample demonstrates an image size converter built with the Python RESTful service. The API returns the resized image as a byte stream, which you can write to disk or transmit further. A successful call returns HTTP 200; possible error codes include 400, 401, 404, 500, and 501.
For converting an SVG image to WMF, see the article Convert SVG to WMF with Python REST API.
Keywords: change size of the image with Python REST API; decrease pic size with Python Low Code API; image size converter with Python RESTful Service; photo size converter with Python REST Interface.