Here you can find the source of getPixelsMatrixFromBitmap(Bitmap bitmap)
public static int[][] getPixelsMatrixFromBitmap(Bitmap bitmap)
//package com.java2s; //License from project: Apache License import android.graphics.Bitmap; public class Main { public static int[][] getPixelsMatrixFromBitmap(Bitmap bitmap) { int[][] pixelMatrix = new int[bitmap.getWidth()][bitmap.getHeight()]; for (int i = 0; i < bitmap.getWidth(); i++) for (int j = 0; j < bitmap.getHeight(); j++) pixelMatrix[i][j] = bitmap.getPixel(i, j); return pixelMatrix; }/*from w ww . ja v a2 s . c o m*/ }