A rectangle in plane with sides parallel to axes can be characterized by two points : top left (x1, y1)
and bottom right (x2, y2)
corners. So just use getSubImage()
appropriately :
/*
(x1, y1) ....... (w = y2-y1) .. (x2, y1)
.
.
(h = y2-y1)
.
.
(x1, y2) .......................(x2, y2) */
BufferedImage myImaxe;
myImage.getSubImage(x1, y1, (x2-x1), (y2-y1));