Convert a raw negative rgb int value back to a 3 number rgb value
问题 Ok so I'm working on a program that takes in an image, isolates a block of pixels into an array, and then gets each individual rgb value for each pixel in that array. When I do this //first pic of image //just a test int pix = myImage.getRGB(0,0) System.out.println(pix); It spits out -16106634 I need to get the (R, G, B) value out of this int value Is there a formula, alg, method? 回答1: The BufferedImage.getRGB(int x, int y) method always returns a pixel in the TYPE_INT_ARGB color model. So