import java.awt.*; import java.awt.image.*; import javax.imageio.ImageIO; import java.io.File; import java.io.IOException; class Main { static final int X = 16, Y = 16; static BufferedImage I = new BufferedImage(X, Y, BufferedImage.TYPE_INT_RGB); static public void main(String[] args){ WritableRaster wr = I.getRaster(); {int[] a = new int[3]; int h = 255; for(int i = 0; i<16; ++i) {for(int j = 0; j<16; ++j) { if (i<8) if (j<8) {a[0] = h; a[1] = 0; a[2] = 0;} else {a[0] = 0; a[1] = h; a[2] = 0;} else if (j<8) {a[0] = 0; a[1] = 0; a[2] = h;} else {a[0] = h; a[1] = h; a[2] = h;} wr.setPixel(i, j, a);}}} try {ImageIO.write(I, "png", new File("favicon.ico"));} catch (IOException e) {System.err.println("image not saved.");} } }