# How do I slice an image of size “width × height” in n² pieces of size “width / n × height / n”?

Background: What I want is to make a jigsaw from an image. (A simple one where the pieces are polygons.) I have the following strategy in mind. Create a set of polygons and assign images (or just the original image) to them as a texture and set the texture coordinates. I know from the documentation (Lena example) how to use an image as a texture. Is chopping up the image in parts and assign these parts as textures a feasible strategy? If so, then I have the following question:

Question: Given an image of size width × height, how do I slice it in n² pieces of size width / n × height / n ?

• Considering I often underestimate Mathematica you can imagine how content I am with the product. – nilo de roock Jun 24 '12 at 15:04

ImagePartition[] is the function you need:
With[{n = 4, img = ExampleData[{"TestImage", "Mandrill"}]},