ImageHelper { public static BufferedImage editHue(Image img, float percent) { if ((percent < 0) || (percent > 1)) { throw new IllegalArgumentException(); } return edit(img, "h", percent); } private  ImageHelper(); static BufferedImage edit(Image img, String property,
            float percent); static BufferedImage editHue(Image img, float percent); static BufferedImage editHue(BufferedImage img, float percent); static BufferedImage editHue(javafx.scene.image.Image img,
            float percent); static BufferedImage editSaturation(Image img, float percent); static BufferedImage editSaturation(BufferedImage img,
            float percent); static BufferedImage editSaturation(javafx.scene.image.Image img,
            float percent); static BufferedImage editBrightness(Image img, float percent); static BufferedImage editBrightness(BufferedImage img,
            float percent); static BufferedImage editBrightness(javafx.scene.image.Image img,
            float percent); static BufferedImage blend(BufferedImage img1, BufferedImage img2,
            double bias); static BufferedImage blend(BufferedImage img1, Image img2,
            double bias); static BufferedImage blend(BufferedImage img1,
            javafx.scene.image.Image img2, double bias); static BufferedImage blend(Image img1, Image img2, double bias); static BufferedImage blend(Image img1, javafx.scene.image.Image img2,
            double bias); static BufferedImage blend(javafx.scene.image.Image img1,
            javafx.scene.image.Image img2, double bias); static BufferedImage add(BufferedImage img1, BufferedImage img2,
                                      double bias); static BufferedImage add(BufferedImage img1, Image img2,
                                      double bias); static BufferedImage add(BufferedImage img1,
                                      javafx.scene.image.Image img2, double bias); static BufferedImage add(Image img1, Image img2, double bias); static BufferedImage add(Image img1, javafx.scene.image.Image img2,
                                      double bias); static BufferedImage add(javafx.scene.image.Image img1,
                                      javafx.scene.image.Image img2, double bias); static BufferedImage subtract(BufferedImage img1, BufferedImage img2,
                                    double bias); static BufferedImage subtract(BufferedImage img1, Image img2,
                                    double bias); static BufferedImage subtract(BufferedImage img1,
                                    javafx.scene.image.Image img2, double bias); static BufferedImage subtract(Image img1, Image img2, double bias); static BufferedImage subtract(Image img1, javafx.scene.image.Image img2,
                                    double bias); static BufferedImage subtract(javafx.scene.image.Image img1,
                                    javafx.scene.image.Image img2, double bias); static BufferedImage toBufferedImage(Image img); static BufferedImage deepCopy(BufferedImage image);  }
@Test public void checkMoreHue() { try { File file = new File( this.getClass().getResource("/ground/grass.png").toURI()); BufferedImage bufferedOriginal = ImageIO.read(file); Image awt1; Image awt2; BufferedImage buffered1; BufferedImage buffered2; awt1 = (Image) ImageIO.read(file); awt2 = (Image) ImageIO.read(file); Assert.assertTrue("awt image edit not increasing hue", more(ImageHelper.editHue(awt1, (float) 0.9), ImageHelper.editHue(awt2, (float) 0.1), 0)); buffered1 = ImageIO.read(file); buffered2 = ImageIO.read(file); Assert.assertTrue("buffered image edit not increasing hue", more(ImageHelper.editHue(buffered1, (float) 0.9), ImageHelper.editHue(buffered2, (float) 0.1), 0)); } catch (IOException e) { Assert.assertFalse("Exception loading image" + e.toString(), e instanceof IOException); } catch (URISyntaxException e) { Assert.fail("URISyntaxException: " + e.getMessage()); } }
@Test public void checkLessHue() { try { File file = new File( this.getClass().getResource("/ground/grass.png").toURI()); BufferedImage bufferedOriginal = ImageIO.read(file); Image awt1; Image awt2; BufferedImage buffered1; BufferedImage buffered2; awt1 = (Image) ImageIO.read(file); awt2 = (Image) ImageIO.read(file); Assert.assertTrue("awt image edit not increasing hue", less(ImageHelper.editHue(awt1, (float) 0.1), ImageHelper.editHue(awt2, (float) 0.9), 0)); buffered1 = ImageIO.read(file); buffered2 = ImageIO.read(file); Assert.assertTrue("buffered image edit not increasing hue", less(ImageHelper.editHue(buffered1, (float) 0.1), ImageHelper.editHue(buffered2, (float) 0.9), 0)); } catch (IOException e) { Assert.assertFalse("Exception loading image" + e.toString(), e instanceof IOException); } catch (URISyntaxException e) { Assert.fail("URISyntaxException: " + e.getMessage()); } }