728x90
#pip install pillow
from PIL import Image
img = Image.open(r"D:\Downloads\test.jpg")
# x start, y start, x length, y length
crop_area = (201,343,1491,1097)
cropped_img = img.crop(crop_area)
cropped_img.show()
cropped_img.save('D:/Downloads/' + 'test-croped' +'.jpg', 'JPEG')728x90
'Python' 카테고리의 다른 글
| 오렌지3로 머신러닝 해보기 (0) | 2022.05.16 |
|---|---|
| pywinauto 사용해보기 (0) | 2022.04.05 |
| [python] pdf를 이미지로 변환 (0) | 2022.02.11 |
| [python] 컨플루언스에 파일 첨부하기 (0) | 2022.02.08 |
| 파이썬 번역 - googletrans (0) | 2022.01.20 |