Image im;
BufferedImage bi;
//im初始化int wh;
bi=new BufferedImage(whBufferedImageTYPE_INT_ARGB);
GraphicsD big=bicreateGraphics();
bigdrawImage(imthis);
public void colorgray(){
ColorSpace cs=ColorSpacegetInstance(ColorSpaceCS_GRAY);
ColorConvertOp colorConvert=new ColorConvertOp(csnull);
colorConvertfilter(bi bi);
}
//可以repaint了只是在缓存区里面并不是真正修改了文件