static BufferedImage img_getCenterPortion(BufferedImage img, int w, int h) { int iw = img.getWidth(), ih = img.getHeight(); if (iw < w || ih < h) fail("Too small"); int x = (iw-w)/2, y = (ih-h)/2; ret clipBufferedImage(img, x, y, w, h); }