Java examples for 2D Graphics:BufferedImage Color
get Green from BufferedImage
//package com.java2s; import java.awt.image.BufferedImage; public class Main { public static int getGreen(BufferedImage i, int x, int y) { return ((i.getRGB(x, y) >> 8) & 255); }/* w ww .java2 s .com*/ public static int[] getRGB(BufferedImage i, int x, int y) { int rgb = i.getRGB(x, y); int[] res = new int[3]; res[0] = (rgb >> 16) & 255; res[1] = (rgb >> 8) & 255; res[2] = (rgb) & 255; return res; } }