Implement 16 grayscale support for image module

This commit is contained in:
Ace
2023-12-14 01:51:10 +01:00
parent 1138f2d862
commit a7e2a852e9
5 changed files with 26 additions and 26 deletions

View File

@@ -8,6 +8,7 @@ import os
import time
import traceback
import PIL
import requests
from PIL import ImageFont, ImageDraw, Image
@@ -335,10 +336,10 @@ def draw_border(image, xy, size, radius=5, thickness=1, shrinkage=(0.1, 0.1)):
draw.arc((c7, c8), 90, 180, fill=colour, width=thickness)
def draw_border_2(im: Image, xy: tuple, size: tuple, radius: int):
def draw_border_2(im: PIL.Image, xy: tuple, size: tuple, radius: int):
draw = ImageDraw.Draw(im)
x, y = xy
w, h = size
draw.rounded_rectangle(xy=(x, y, x + w, y + h), outline="black", radius=radius)
draw.rounded_rectangle(xy=(x, y, x + w, y + h), outline="black", radius=radius)