Here you can find the source of pixelsFromBufferedImage(final BufferedImage image)
public static int[][] pixelsFromBufferedImage(final BufferedImage image)
//package com.java2s; //License from project: Open Source License import java.awt.image.BufferedImage; public class Main { public static int[][] pixelsFromBufferedImage(final BufferedImage image) { int[][] pixArr = new int[image.getWidth()][image.getHeight()]; for (int x = 0; x < image.getWidth(); x++) { for (int y = 0; y < image.getHeight(); y++) { pixArr[x][y] = image.getRGB(x, y); }/* ww w . j ava 2 s. c om*/ } return pixArr; } }