package main import ( "learning/genimage/pic" "flag" ) func Pic(dx, dy int) [][]uint8 { result := make([][]uint8, dy) var ii, jj uint8 for j := 0; j < dy; j++ { result[j] = make([]uint8, dx) for i := 0; i < dx; i++ { ii = uint8(i) jj = uint8(j) result[j][i] = ii ^ jj } } return result } func main() { flag.Parse() image := pic.CalculateImage(Pic) pic.SaveImage(flag.Arg(0), image) }