获取及修改图像的RGB值和Alpha值

        //获取及修改图像的RGB值和Alpha值
        ColorModel cm=ColorModel.getRGBdefault();
        for(int i=0;i<w*h;i++){
            int alpha=cm.getAlpha(pixels[i]);
            int red=cm.getRGB(pixels[i]);
            int green=cm.getGreen(pixels[i]);
            int blue=cm.getBlue(pixels[i]);
            //有了上面这些,就可以为所欲为了
            pixels[i]=alpha<<24|red<<16|green<<8|blue;
        }
原文地址:https://www.cnblogs.com/frostbelt/p/1766317.html