From 29e020bdc3243f32e119d7183c85407578458247 Mon Sep 17 00:00:00 2001 From: tkekec Date: Sat, 22 Oct 2022 12:39:41 +0300 Subject: [PATCH] draw circle --- python-core.tex | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/python-core.tex b/python-core.tex index e565a4a..8039fad 100755 --- a/python-core.tex +++ b/python-core.tex @@ -2052,7 +2052,7 @@ plt.imshow(rgb_image_float) \end{python} -\subsubsection{Draw circle on Image} +\subsubsection{Draw circle on PIL Image} \begin{python} from PIL import Image, ImageDraw image = Image.new('RGBA', (200, 200)) @@ -2063,6 +2063,18 @@ draw.point((100, 100), 'red') image.save('test.png') \end{python} +\subsubsection{Draw text on PIL Image} +\begin{python} +from PIL import Image, ImageDraw +image = Image.new('RGBA', (200, 200)) +draw = ImageDraw.Draw(image) +# drawing text size +text = "hello" +font = ImageFont.truetype(r'C:\Users\System-Pc\Desktop\arial.ttf', 20) +draw.text((5, 5), text, fill ="red", font = font, align ="right") +image.save('test.png') +\end{python} + \subsubsection{Flip, resize, rotate, crop images} \begin{python} import cv2