package work;
import java
import java
import lor
import java
import java
import java
import java
import javax
public class Gray {
public static void main(String[] args) throws IOException
{
BufferedImage transforImage;
BufferedImage finalImage;
TransGray gray=new TransGray();
transforImage=gray
finalImage=gray
File f
ImageIO
System
}
}
class TransGray
{
int width;
int height;
BufferedImage srcImage;
public TransGray() throws IOException
{
File file =new File(
srcImage =ImageIO
width=srcImage
height=srcImage
}
public BufferedImage transformGrayJ
BufferedImage dstImage = new BufferedImage(srcImage
if (hints == null ) {
Graphics
hints = g
g
g
}
ColorSpace grayCS = ColorSpace
ColorConvertOp colorConvertOp = new ColorConvertOp(grayCS
colorConvertOp
return dstImage;
}
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/26706.html