📜  如何迭代像素图像java代码示例

📅  最后修改于: 2022-03-11 14:52:04.453000             🧑  作者: Mango

代码示例1
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);
    }
}