Golang, Performance, Programming.
createPixel(width, height int) image.Image { m := image.NewGray(image.Rect(0, 0, width, height)) var w sync.WaitGroup w.Add(width * height) for i := 0; i < width; i++ { for j := 0; j < height; j++ { go func(i, j int) { m.Set(i, j, pixel(i, j, width, height)) w.Done() }(i, j) } } w.Wait() return m }