Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python draw rectangle on image

img = matplotlib. image. imread("./kite_logo.png")
figure, ax = pyplot. subplots(1)
rect = patches. Rectangle((125,100),50,25, edgecolor='r', facecolor="none")
ax. imshow(img) Displays an image.
ax. add_patch(rect) Add rectangle to image.
Comment

add rectangle to image python

from PIL import ImageDraw

draw = ImageDraw.Draw(<your_image>)
draw.rectangle(((20, 30), (10, 10)), fill="white")		# (x1, y1), (x2, y2)

plt.imshow(test)
Comment

PREVIOUS NEXT
Code Example
Python :: huggingface transformers change download path 
Python :: python offline translate pypi 
Python :: builtwith python 
Python :: python subtract every element in list 
Python :: python filter timestamp 
Python :: django queryset to form 
Python :: how to make python file executable 
Python :: connect a mean value to histogram pandas 
Python :: write a file python 
Python :: Triangle Quest 
Python :: code fibonacci python 
Python :: dijkstras python 
Python :: assign a same value to 2 variables at once python 
Python :: sorting a list of dictionaries 
Python :: python assert is not null 
Python :: Matplotlib rotated xticklabels 
Python :: how to take date as input in python 
Python :: integer xticks 
Python :: turtle star python 
Python :: pip uninstalled itself 
Python :: get last 3 in list python 
Python :: delete from list python 
Python :: python index 2d array 
Python :: how to extract domain name from url python 
Python :: drop-trailing-zeros-from-decimal python 
Python :: int to alphabet letter python 
Python :: python pd.Timestamp add days 
Python :: this figure includes axes that are not compatible with tight_layout, so results might be incorrect 
Python :: Generate 3 random integers between 100 and 999 which is divisible by 5 
Python :: how to allow only for create field in serializer 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =