public static int[][] getPixelArray(Image image) {
		ImageObserver observer = getImageObserver();
		int width = image.getWidth(observer);
		int height = image.getHeight(observer);
		int[] pixels = new int[width * height];
		int[][] array = new int[height][width];
		PixelGrabber pg = new PixelGrabber(image.getSource(), 0, 0, width, height, pixels, 0, width);
		try {
			pg.grabPixels();
		} catch (InterruptedException e) {
			throw new ErrorException("Transfer interrupted");
		}
		if ((pg.getStatus() & ImageObserver.ABORT) != 0) {
			throw new ErrorException("Transfer aborted");
		}
		for (int i = 0; i < height; i++) {
			System.arraycopy(pixels, i * width, array[i], 0, width);
		}
		return array;
	}