sbool pointOutsideOfImage(BufferedImage img, Pt p) { ret p.x < 0 || p.y < 0 || p.x >= img.getWidth() || p.y >= img.getHeight(); }