|
|
|
|
@ -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 |
|
|
|
|
|