public int[][] getImagePixels(BufferedImage image) {
        int w = image.getWidth(null);
        int h = image.getHeight(null);
        int[] tmpPixels = new int[w * h];
        image.getRGB(0, 0, w, h, tmpPixels, 0, w);
        int[][] pixels = new int[w][h];
        
        for(int y = 0; y < h; y++) {
            for(int x = 0; x < w; x++) {
                pixels[x][h-1-y] = tmpPixels[x+y*w] & Integer.parseInt("FFFFFF", 16);
            }
        }
        return pixels;
    }