Answers for "how to iterate pixels image java"

0

how to iterate pixels image java

for (int y = 0; y < image.getHeight(); y++) {
    for (int x = 0; x < image.getWidth(); x++) {
          int  clr   = image.getRGB(x, y); 
          int  red   = (clr & 0x00ff0000) >> 16;
          int  green = (clr & 0x0000ff00) >> 8;
          int  blue  =  clr & 0x000000ff;
          image.setRGB(x, y, clr);
    }
}
Posted by: Guest on January-02-2021

Code answers related to "how to iterate pixels image java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language