Python 3 Script to Resize and Crop Image Using resize-and-crop Library Full Project For Beginners

 

 

Installation

 

 

pip install resize-and-crop

 

 

 

Methods

 

  1. resize_and_crop(path, size, crop_origin) – Resize the image located at path, into the size specified, cropping the image starting at the crop_origin.
  2. resized_image_file(image_field, format, dimensions, crop_origin) – Returns a new image file that has the resized image. Can be used to save to a Django ImageField.

 

 

Usage

 

 

app.py

 

 

from resize_and_crop import resize_and_crop

image = resize_and_crop("screenshot.png", (200,200), "middle").save("output.png")

 

See also  Python 3 WxPython Accelerator Table Control Widget Using GridSizer Layout in GUI Desktop App Full Project For Beginners

 

python app.py

 

 

Leave a Reply