Right now i am getting RGb value using two for loops as shown in code below but it took too much long time to get rgb values as loop runs 479999 times for my image and it can even rise when i will use 16 bit image.
SO i need some faster way to get pixel values
here is my code what i tried
BufferedImage bi=ImageIO.read(new File("C:\\images\\Sunset.jpg"));
{
int countloop=0;
for (int x = 0; x <bi.getWidth(); x++) {
for (int y = 0; y < bi.getHeight(); y++) {
Color c = new Color(bi.getRGB(x, y));
System.out.println("red=="+c.getRed()+" green=="+c.getGreen()+" blue=="+c.getBlue()+" countloop="+countloop++);
}
}

New Topic/Question
Reply



MultiQuote








|