The documentation can be a bit confusing sometimes, but in this case it is clearly stated in the elements section of the png help-page

The option "ColorSpace" is only for Import
.
Anyway, what happens when you Export
a png-file is, that (when it is a Graphics
or Graphics3D
) Mathematica calls Rasterize
which accepts the ColorSpace
option. Therefore one solution to your problem is to use
Export["tmp/gray.png", Rasterize[p, ColorSpace -> "Grayscale"]]
A quick test shows, that it creates identical images which only differ in ColorSpace
p = Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}];
Export["tmp/color.png", p]
Export["tmp/gray.png", Rasterize[p, ColorSpace -> "Grayscale"]]
Function[{img},
Import[img, #] & /@ {"BitDepth", "ColorSpace", "DataType",
"ImageSize"}] /@ {col, gray} // Column
(*
{8,RGBColor,Integer,{360,281}}
{8,GrayLevel,Integer,{360,281}}
*)
and they fit exactly onto another
ImageMultiply @@ (Import /@ {col, gray})

ColorSpace
works only withImport
, not withExport
. Perhaps, you canColorConvert[something,"Grayscale"]
and then export as a workaround? $\endgroup$