I need to create 30 * 30 px small images from splitting a large image. I need these parts separately saved in separate files after being split up like so:
Here you go:
import cv2
img = cv2.imread('image.png')
for r in range(0,img.shape[0],30):
for c in range(0,img.shape[1],30):
cv2.imwrite(f"img{r}_{c}.png",img[r:r+30, c:c+30,:])
Try use image_slicer. (8 x 8 from your description)
import image_slicer
image_slicer.slice('C:\\files\\cars.png', 64)
This' how the outputs looked like.