@@ -0,0 +1,1083 @@
+package net.starwix;%0A%0Aimport java.awt.AWTException;%0Aimport java.awt.Graphics;%0Aimport java.awt.image.BufferedImage;%0Aimport java.awt.image.DataBuffer;%0A%0A/**%0A * @author starwix%0A */%0Apublic class ImageArray %7B%0A%09private int%5B%5D%5B%5D data;%0A%09private int type;%0A%09%0A%09public ImageArray(BufferedImage image, int type) %7B%0A%09%09int w = image.getWidth();%0A%09%09int h = image.getHeight();%0A%0A%09%09if (image.getType() != type) %7B%0A%09%09%09BufferedImage temp = new BufferedImage(w, h, type);%0A%09%09%09Graphics g = temp.getGraphics();%0A%09%09%09g.drawImage(image, 0, 0, null);%0A%09%09%09g.dispose();%0A%09%09%09image = temp;%0A%09%09%7D%0A%09%09this.type = type;%0A%09%09%0A%09%09DataBuffer t = image.getRaster().getDataBuffer(); // work fast%0A%09%09data = new int%5Bh%5D%5Bw%5D;%0A%09%09for (int y = 0; y %3C h; y++) %7B%0A%09%09%09for (int x = 0; x %3C w; x++) %7B%0A%09%09%09%09data%5By%5D%5Bx%5D = t.getElem(y * w + x);%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%09public ImageArray(BufferedImage image) throws AWTException %7B%0A%09%09this(image, image.getType());%0A%09%7D%0A%09%0A%09public int%5B%5D%5B%5D getData() %7B%0A%09%09return data;%0A%09%7D%0A%09%0A%09public int getType() %7B%0A%09%09return type;%0A%09%7D%0A%09%0A%09public int getHeight() %7B%0A%09%09return data.length;%0A%09%7D%0A%09%0A%09public int getWidth() %7B%0A%09%09return data%5B0%5D.length;%0A%09%7D%0A%7D %0A

Add the class that allows to work with image as array.