Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pillow python crop

im = Image.open('image.jpg') 
im = im.crop((left, top, width, height))

#       ├─input image width─┤
#   ┬   ┌───────────────────┐ ┬   ┬   
#   │   │                   │top  │   
# input │       ┌───────┐   │ ┴ height
# image │       │       │   │     │   
# height│       └───────┘   │     ┴   
#   │   │                   │  
#   ┴   └───────────────────┘   
#       ├─left─┤
#       ├─────width─────┤
Comment

pil crop image

im = Image.open('image.jpg') 
im = im.crop((left, top, right, bottom))  # coordinates of the crop
Comment

PREVIOUS NEXT
Code Example
Python :: how to url encode using python django 
Python :: python get file name without dir 
Python :: print boolean in python 
Python :: simple secatter plot 
Python :: python ftplib get list of directories 
Python :: skip element in list comprehension 
Python :: changing plot background color in python 
Python :: python printing variables 
Python :: how to get bot voice channel discord.py 
Python :: webdriver firefox install 
Python :: list to dataframe 
Python :: python write line break 
Python :: numpy combinations of 5 bits 
Python :: valor absoluto en python 
Python :: how to get month name from date in pandas 
Python :: standard deviation python 
Python :: aes in python 
Python :: python hide details 
Python :: string formatting in python 
Python :: python to run another code on timer while a separate code runs 
Python :: pandas dataframe lists as columns 
Python :: radix sort in python 
Python :: python how to replace a certain string in text 
Python :: copy website 
Python :: docker django development and production 
Python :: how to get key of a particular value in dictionary python using index 
Python :: split pandas row into multiple rows 
Python :: pymupdf extract all text from pdf 
Python :: version python 
Python :: python delete value from dictionary 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =