Skip to content

Instantly share code, notes, and snippets.

@arnav-gudibande
Created April 23, 2016 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnav-gudibande/8b56c638d6e517c3ddf77ecb842539e7 to your computer and use it in GitHub Desktop.
Save arnav-gudibande/8b56c638d6e517c3ddf77ecb842539e7 to your computer and use it in GitHub Desktop.
gets the color of a pixel in a buffered image
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