Categories
Pillow, OpenCV Python: how to crop an image?
Druste! There is an image that needs to be cropped from X1 Y1 to X2 Y2 using Pillow or Opencv (Python) how to do it? Thanks in advance!
Answer the question
In order to leave comments, you need to log in
https://www.youtube.com/watch?v=mjy1_3ISAnc
from PIL import Image from pathlib import Path imgfile = Path(filename) img = Image.open(imgfile) width = img.size[0] height = img.size[1] img3 = img.crop( (0,0,width,height-20) ) img3.save(filename)
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question