static void drawBoxes(BufferedImage image, L boxes, Color color, float opaqueness) { Graphics2D g = image.createGraphics(); g.setColor(colorWithAlpha(color, opaqueness)); for (Rectangle r : boxes) g.drawRect(r.x-1, r.y-1, r.width+2, r.height+2); g.dispose(); }