INNER CODE UNIT · Python
image
zhulinyv/Semi-Auto-NovelAI-to-Pixiv · src/batch_mosaic.py:71
image = _mosaic_pixel(pil_img, (box[0], box[1], box[0] + box[2], box[1] + box[3]), neighbor)
image.save(img_path)
revert_img_info(None, img_path, pil_img.info)
# -------------------- #
def mosaic_lines(img_path):
img_path = str(img_path)
box_list = detector(img_path)
with Image.open(img_path) as image:
draw = ImageDraw.Draw(image)
for box in box_list:
x, y, w, h = box
while y <= box[1] + box[3]:
xy = [(x, y), (x + w, y)]