INNER CODE UNIT · Python
__mosaic_blurry
zhulinyv/Semi-Auto-NovelAI-to-Pixiv · src/batch_mosaic.py:14
def __mosaic_blurry(img, length):
s = img.size
img = img.resize((int(length * 0.01), int(length * 0.01)))
img = img.resize(s)
return img
def _mosaic_blurry(img, fx, fy, tx, ty):
length = img.width if img.width > img.height else img.height
c = img.crop((fx, fy, tx, ty))
c = __mosaic_blurry(c, length)
img.paste(c, (fx, fy, tx, ty))
return img
def mosaic_blurry(img):
img = str(img)
with Image.open(img) as image: