이 프로그램에서는 Pillow 라이브러리를 사용하여 이미지를 자릅니다. 우리는 같은 경우에 자르기() 함수를 사용할 것입니다. 이 함수는 이미지를 자르기 위해 왼쪽, 위쪽, 오른쪽, 아래쪽 픽셀 좌표를 사용합니다.
원본 이미지

알고리즘
Step 1: Import Image from Pillow. Step 2: Read the image. Step 3: Crop the image using the crop function. Step 4: Display the output.
예시 코드
from PIL import Image
im = Image.open('testimage.jpg')
width, height = im.size
left = 5
top = height / 2
right = 164
bottom = 3 * height / 2
im1 = im.crop((left, top, right, bottom))
im1.show() 출력
