I found subimage a little slow in the past (I had to cut images for Mini Adventure). I ended up doing something like…
Image originalImage = (get a 256x256 image here)
int xsections = originalImage.getWidth(null) / TILE_SIZE;
int ysections = originalImage.getHeight(null) / TILE_SIZE;
BufferedImage[][] tiles = new BufferedImage[xsections][ysections]
for (int x=0;x<xsections;x++)
{
for (int y=0;y<ysections;y++)
{
tiles[x][y] = new BufferedImage(TILE_SIZE,TILE_SIZE,BufferedImage.TYPE_INT_ARGB);
Graphics g = tiles[x][y].getGraphics();
g.drawImage(originalImage,-x*TILE_SIZE,-y*TILE_SIZE,null);
}
}
This draws the whole original image into the smaller buffered images but because of clipping just causes a section of the original image to be drawn (hence the offsets on the image draw). It seemed to me that drawing images was quicker than extracting sections of image. Strange I know, but it matched the results I got.
Kev