So basically images are stored in form of arrays e.g. image[1365,2048,3] here 0th and 1st dimensions are number of rows and columns and the 3rd Dimension is value of color in cell formed by it.
Using python we can manipulate the image and our filters or crop image.
To load and show image we need cv2 library and for editing photo we need to manipulate the array using numpy.
Example Code:
import cv2
photo=cv2.imread("image.jpg") //stores image in photo variable
cropPhoto = photo[10:100,10:100] //slices photo and shows only from 10 to 99th row and column
cv2.imshow("cropped",cropPhoto)
cv2.waitKey()
cv2.destroyAllWindows()
Similarly you can perform various array operations to edit your photos.