from PIL import Image

infile = "ja.PNG"
chopsize = 300

img = Image.open(infile)
width, height = img.size

# Save Chops of original image
for x0 in range(0, width, chopsize):
   for y0 in range(0, height, chopsize):
      box = (x0, y0,
             x0+chopsize if x0+chopsize <  width else  width - 1,
             y0+chopsize if y0+chopsize < height else height - 1)
      print('%s %s' % (infile, box))
      img.crop(box).save('C:\\Users\\tobby48\\Desktop\\지문자\\zchop.%s.x%03d.y%03d.jpg' % (infile.replace('.jpg',''), x0, y0))
    