Created
April 23, 2016 17:12
-
-
Save arnav-gudibande/8b56c638d6e517c3ddf77ecb842539e7 to your computer and use it in GitHub Desktop.
gets the color of a pixel in a buffered image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int getColorPixel(double x, double y, BufferedImage image) throws IOException { | |
int xx = (int) x; | |
int yy = (int) y; | |
int clr = image.getRGB(xx,yy); | |
int blue = clr & 0x000000ff; | |
return blue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment