заданным значениям?
pic_path = "o.png"
step = 10
img = cv2.imread(pic_path)
w, h = img.shape[:2]
w = int(w/step)*step
h = int(h/step)*step
print("orig ", *img.shape)
print("calc ", w,h)
img = img[0:h, 0:w]
print("rez ", *img.shape)
orig 576 1024 3
calc 570 1020
rez 576 570 3
try Pillow
Обсуждают сегодня