I'm working on a program that takes an image png, this image has been compressed using the following method (RLE).
Isolates a block of pixels into an array, and then gets each individual rgb value for each pixel in that array.
int rgb = image.getRGB(0,0);
It spits out negative number
I need to get the 1 value integer out of this negative value, because the first pixel is actually an integer that represents the total number of pixel colors that must be repeated to build the decompressed image
I try with this method :
String clr = Integer.toHexString(value).substring(2);
int n = Integer.parseInt(clr, 16);
Is there a formula, alg, method best?