src/main/java/ch/wetwer/moviefleur/color/ColorFilter.java
/**
     * @param image image to be inverted
     *
     * @return an inverted image where all rgb values are flipped
     */
@param image image to be inverted
@return an inverted image where all rgb values are flipped
@param image image to be inverted @return an inverted image where all rgb values are flipped
public static BufferedImage invert(BufferedImage image) {
        for (int x = 0; x < image.getWidth(); x++) {
            for (int y = 0; y < image.getHeight(); y++) {
                Color col = new Color(image.getRGB(x, y), true);
                col = new Color(255 - col.getRed(),
                        255 - col.getGreen(),
                        255 - col.getBlue());
                image.setRGB(x, y, col.getRGB());
            }
        }
        return image;
    }
public static BufferedImage invert ( BufferedImage image ) { for ( int x = 0 ; x < image . getWidth ( ) ; x ++ ) { for ( int y = 0 ; y < image . getHeight ( ) ; y ++ ) { Color col = new Color ( image . getRGB ( x , y ) , true ) ; col = new Color ( 255 - col . getRed ( ) , 255 - col . getGreen ( ) , 255 - col . getBlue ( ) ) ; image . setRGB ( x , y , col . getRGB ( ) ) ; } } return image ; }
@param image image to be inverted
 @return an inverted image where all rgb values are flipped
@param image image to be inverted @return an inverted image where all rgb values are flipped