title: How to found center of an image?
body: <p>I have faced trouble how to find center of an image and write it to different image.
  Situation is that I have image (for e.g. 800X500) and I need to crop exactly (50X50 or 70X70) center of it with img.getSubimage(x, y, w, h).</p>
  
  <p>Sizes will be different every time for new image.</p>
  
  <p>How could I calculate X and Y to get 50X50 subImage from the image center?</p>
  
  <p>Thanks in advance.</p>
  
  <p>img.getSubimage(x, y, w, h) - <strong>X and Y are not coordinates of center.</strong> 
       * @param x the X coordinate of the upper-left corner of the
       *          specified rectangular region
       * @param y the Y coordinate of the upper-left corner of the
       *          specified rectangular region</p>