static int pixelCount(BufferedImage img) { ret img == null ? 0 : img.getWidth()*img.getHeight(); }