Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python image processing and resizing

image = Image.open('demo_image.jpg')
image.thumbnail((400, 400))
image.save('image_thumbnail.jpg')

print(image.size) # Output: (400, 267)
Comment

image processing and resizing with python

image = Image.open('demo_image.jpg')
box = (200, 300, 700, 600)
cropped_image = image.crop(box)
cropped_image.save('cropped_image.jpg')

# Print size of cropped image
print(cropped_image.size) # Output: (500, 300)
Comment

image processing and resizing with python

image = Image.open('demo_image.jpg')
logo = Image.open('logo.png')
image_copy = image.copy()
position = ((image_copy.width - logo.width), (image_copy.height - logo.height))
image_copy.paste(logo, position)
image_copy.save('pasted_image.jpg')
Comment

image processing and resizing with python

image = Image.open('demo_image.jpg')

image_rot_90 = image.rotate(90)
image_rot_90.save('image_rot_90.jpg')

image_rot_180 = image.rotate(180)
image_rot_180.save('image_rot_180.jpg')
Comment

PREVIOUS NEXT
Code Example
Python :: how to create customer using python api of shopify 
Python :: django reverse accessor clashes for abstract class 
Python :: KMeans 
Python :: jupter notebook save session variables 
Python :: extracts attribute python xml 
Python :: how to find largest number in list python without max 
Python :: how to code a jumping function in python 
Python :: easygui text adventure in python 3 
Python :: orm odoo 
Python :: pyglet key hold 
Python :: add suffix to multiple file names python 
Python :: how to take matrix input in python 
Python :: site:www.python-kurs.eu generators 
Python :: python function guts 
Python :: Aminul 
Python :: how to read comment before the root element of xml python 
Python :: 1051 texes uri solution 
Python :: Joint Grid plot in seaborn 
Python :: add function name and line number in python log file 
Python :: how to connect smartphone camera to opencv python 
Python :: How to Remove Items in a Set in Python Using the remove() Method 
Python :: how to remove all line in file python 
Python :: calculate iou of two rectangles 
Python :: python math.factorial algorithm 
Python :: Create An Empty List(Array) In Python 
Python :: how to strip characters in python 
Python :: python rest api interview questions 
Python :: python code to executable online converter 
Python :: way to close file python with staement 
Python :: Using iterable unpacking operator * 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =