ImageUtil { public static BufferedImage bufferedImageFromImage(final Image image) { if (image instanceof BufferedImage) { return (BufferedImage) image; } return toARGB(image); }  static BufferedImage bufferedImageFromImage(final Image image); static BufferedImage toARGB(final Image image); static BufferedImage luminanceOffset(final Image rawImg, final int offset); static BufferedImage luminanceScale(final Image rawImg, final float percentage); static BufferedImage alphaOffset(final Image rawImg, final int offset); static BufferedImage alphaOffset(final Image rawImg, final float percentage); static BufferedImage grayscaleImage(final BufferedImage image); static BufferedImage resizeImage(final BufferedImage image, final int newWidth, final int newHeight); static BufferedImage resizeCanvas(final BufferedImage image, final int newWidth, final int newHeight); static BufferedImage rotateImage(final BufferedImage image, final double theta); static BufferedImage flipImage(final BufferedImage image, final boolean horizontal, final boolean vertical); static BufferedImage outlineImage(final BufferedImage image, final Color color); static BufferedImage outlineImage(final BufferedImage image, final Color color, final Boolean outlineCorners); static BufferedImage getResourceStreamFromClass(final Class c, final String path); static BufferedImage fillImage(final BufferedImage image, final Color color); static SpritePixels getImageSpritePixels(BufferedImage image, Client client); static IndexedSprite getImageIndexedSprite(BufferedImage image, Client client);  }
@Test public void bufferedImageFromImage() { final BufferedImage buffered = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); assertEquals(buffered, ImageUtil.bufferedImageFromImage(buffered)); }