I'm working with BufferedImage (in PNG) and want to replace a colour with another.
I have all colours stored as strings for easy handling but...
for(int x=0;x<output.getWidth();x++)
    for(int y=0;y<output.getHeight();y++)
        if(output.getRGB(x,y)==Integer.parseInt("ffff00fe",16))
            output.setRGB(x,y,Integer.parseInt("ffaaaaaa",16));
the resultant integers should be negative numbers, but it throws NumberFormatException
when I do output.getRGB(x,y) it returns negative numbers on non-transparent pixels
 
     
     
    