code: func Grayscale(img image.Image) *image.NRGBA {
  	src := newScanner(img)
  	dst := image.NewNRGBA(image.Rect(0, 0, src.w, src.h))
  	parallel(0, src.h, func(ys <-chan int) {
  		for y := range ys {
  			i := y * dst.Stride
  			src.scan(0, y, src.w, y+1, dst.Pix[i:i+src.w*4])
  			for x := 0; x < src.w; x++ {
  				d := dst.Pix[i : i+3 : i+3]
  				r := d[0]
  				g := d[1]
  				b := d[2]
  				f := 0.299*float64(r) + 0.587*float64(g) + 0.114*float64(b)
  				y := uint8(f + 0.5)
  				d[0] = y
  				d[1] = y
  				d[2] = y
  				i += 4
  			}
  		}
  	})
  	return dst
  }
docs: // Grayscale produces a grayscale version of the image.