Reading Pixels from JPEG Image

Hi All,I need to read the pixels that available in JPEG imae and need to store it in Array , can anyone suggest me the way to do it, Thanks in Advance.With Regards,Justin
[198 byte] By [Justin.SAPa] at [2007-10-2 5:00:36]
# 1

be sure to import java.awt.image.PixelGrabber;

public static int[] getPixels(BufferedImage victim){

PixelGrabber pg;

int[] pixels = new int[victim.getWidth() * victim.getHeight()];

try{

pg = new PixelGrabber(victim, 0, 0, victim.getWidth(), victim.getHeight(), pixels, 0, victim.getWidth());

pg.grabPixels(0);

} catch (Exception e){

e.printStackTrace();

}

return pixels;

}

SashaZa at 2007-7-16 1:04:31 > top of Java-index,Security,Cryptography...