I'm trying to open a PNG file and display the value of each pixel.
Pixmap pixmap = new Pixmap(new FileHandle("images/Laby0.png"));
int widthPixmap = pixmap.getWidth();
int heightPixmap = pixmap.getHeight();
for(int y=0; y < heightPixmap; y++){
for(int x=0; x < widthPixmap; x++){
int color = pixmap.getPixel(x, y);
System.out.println("X : "+ x + " y : " + y + " color = " +color);
}
}
The PGN file has only some white, black and levels of gray, but the output are values like -256, and -1!
Why does it not give positive values ?