private Image invertImage(URL imageName) {
        
		//BufferedImage inputFile = (BufferedImage) input;
		BufferedImage inputFile = null;
        try {
            inputFile = ImageIO.read(imageName);
        } catch (IOException e) {
            e.printStackTrace();
        }

        for (int x = 0; x < inputFile.getWidth(); x++) {
            for (int y = 0; y < inputFile.getHeight(); y++) {
                int rgba = inputFile.getRGB(x, y);
                Color col = new Color(rgba, true);
                col = new Color(255 - col.getRed(),
                                255 - col.getGreen(),
                                255 - col.getBlue());
                inputFile.setRGB(x, y, col.getRGB());
            }
        }

        return (Image) inputFile;
    }