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 :: DiscordUtils 
Python :: how to load images from folder in python 
Python :: opencv houghlines only horizontal 
Python :: django amzon like app 
Python :: pandas mean and sum 
Python :: where is titainum ore skyblock 
Python :: jupyter notebook save as python script without terminal prompts line numbers 
Python :: python assign variable to another variable 
Python :: turtle meaning 
Python :: pandas data frame from part of excel easy 
Python :: loop only to the 6th element python 
Python :: python copy dictionary keep original same 
Python :: python gpsd client 
Python :: TypeError: get() takes 1 positional argument but 2 were given 
Python :: jupyter early exit cell 
Python :: django file field from base64 
Python :: what is quit block in python 
Python :: add js file in web.assets_backend 
Python :: How split() works when maxsplit is specified 
Python :: Distribute Candy Algorithm Python 
Python :: How to add an item from another set or other data structures (lists, dictionaries, and tuples) to a set by using the update() method. 
Python :: reverse bolean python 
Python :: nim game in python 
Python :: webcolors python 
Python :: python - Creating Tkinter buttons to stop/skip a 2D loop [Solved 
Python :: check true false in python 
Python :: python pod status phase 
Python :: python script to open google chrome 
Python :: flask in colab ngrok error 
Python :: eastcoders: django-meta-class 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =