I'm assuming that you're using the PixelGrabber(ImageProducer ip, int x, int y, int w, int h, int[] pix, int off, int scansize)
constructor, in which case what you're getting back is an integer array of the RGB value of each pixel.
Because it's coming back as an RGB value - you need to seperate out the values to give you a true RGB value. For example RGB(255,255,255) is White and RGB(0,0,0) is black. The API Reference gives a good example of how to do this properly. With the -16777216
number in your question, I performed a simple test which shows that it is actually black:
public class Main {
public static void main(String[] args) {
int pixel = -16777216;
int alpha = (pixel >> 24) & 0xff;
int red = (pixel >> 16) & 0xff;
int green = (pixel >> 8) & 0xff;
int blue = (pixel ) & 0xff;
System.out.println(alpha);
System.out.println(red);
System.out.println(green);
System.out.println(blue);
}
}
Prints out: 255, 0, 0, 0
Follow the API reference linked above for example code of how to handle the pixel data correctly.