import cv2 file_path = "test/20240112_132814.jpg" topLeftX = 1029 topLeftY = 480 bottomRightX = 1252 bottomRightY = 734 image = cv2.imread(file_path) cropped = image # [topLeftY:bottomRightY, topLeftX:bottomRightX] # cv2.imwrite("templates/dungeon/angus.png", cropped) cv2.imshow("preview", cropped) cv2.waitKey(0) cv2.destroyAllWindows()