陈昶聿
23 小时以前 9799e992bc987425f21ad0b799e3d25d822329e3
1
2
3
4
5
6
7
8
9
10
11
from PIL import Image
src = r"C:\Users\86176\.dsh\attachments\v1\objects\20\20844c3f5c9a090e1010da3d62ae091792c3e25fad6bdd38cc991b054f020d95"
out = r"D:\daima\smartor\smartor-web\tmp-img\crop1.png"
img = Image.open(src)
print("size", img.size)
# 箭头头部附近区域
box = (1050, 130, 1450, 420)
crop = img.crop(box)
crop = crop.resize((crop.width * 3, crop.height * 3), Image.LANCZOS)
crop.save(out)
print("saved", out, crop.size)