class myImage extends RGBImageFilter {
int width=0;
int height=0;
int alpha=0;
public myImage(int width,int height,int alpha) {
this.canFilterIndexColorModel=true;
this.width=width;
this.height=height;
this.alpha=alpha;
}
public int filterRGB(int x,int y,int rgb) {
DirectColorModel dcm=(DirectColorModel)ColorModel.getRGBdefault();
int red=dcm.getRed(rgb);
int green=dcm.getGreen(rgb);
int blue=dcm.getBlue(rgb);
return alpha<<24|red<<16|green<<8|blue;
}
}