code: func average(sum []uint64, w, h int, n uint64) *image.RGBA {
  	ret := image.NewRGBA(image.Rect(0, 0, w, h))
  	for y := 0; y < h; y++ {
  		for x := 0; x < w; x++ {
  			index := 4 * (y*w + x)
  			pix := ret.Pix[y*ret.Stride+x*4:]
  			pix[0] = uint8(sum[index+0] / n)
  			pix[1] = uint8(sum[index+1] / n)
  			pix[2] = uint8(sum[index+2] / n)
  			pix[3] = uint8(sum[index+3] / n)
  		}
  	}
  	return ret
  }
docs: // average convert the sums to averages and returns the result.