Well, for example:
import cv2 ds = cv2.imread("path_to_file.png") ds = ds[500:1500, 500:1500] cv2.imwrite("path_to_file2.png", ds)
I just checked, everything is working.