给出大致代码,希望楼主有帮助import java.io.File;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
File f = new File("c:/test.jpeg");
BufferedImage img = ImageIO.read(f);
int width = img.getWidth();//图片宽度
int height = img.getHeight();//图片高度
//从图片读取RGB
int[] imgArr = new int[width * height];
imgArr = img.getRGB(0, 0, width, height, imgArr, 0, width);//新生成一张图片
BufferedImage newImg = new BufferedImag(width, height, BufferedImage.TYPE_INT_RGB);newImg.setRGB(0, 0, width, height, imgArr, 0, width);//设置 RGB基本的取得和设置方法如上,应该对你可以有帮助呵呵