How can my Postscript draw a monochrome (black/white) image embedded from an EPS file such that the black parts of the image are displayed at 50% value?
I have a monochrome EPS file which looks like this:

This image is embedded into a Postscript file, which then draws it. When drawn, I want the image to print or display such that the black parts of the image are drawn as a 50% gray, like this:

The EPS is embedded into the Postscript using the technique shown in https://stackoverflow.com/a/16405528/238886:
/ImageData
currentfile
<< /Filter /SubFileDecode
/DecodeParms << /EODString (*EOD*) >>
>> /ReusableStreamDecode filter
[-->PUT YOUR EPS HERE<--]
*EOD*
def
/IDForm
<< /FormType 1
/BBox [154 321 441 521]
/Matrix [ 1 0 0 1 0 0]
/PaintProc
{ pop
/ostate save def
/showpage {} def
/setpagedevice /pop load def
ImageData 0 setfileposition ImageData cvx exec
ostate restore
} bind
>> def
And drawn like this:
gsave
IDForm execform
grestore
Is there anything I can wrap around the execform to cause the black/white image to be printed/displayed at 50% value?
It really depends on what operations are used inside the EPS file. You could redefine for example setgray like this:
and then on exit redefine it like so:
Now this depends on setgray being used its possible that your eps is using sethsbcolor, setrgbcolor, setcmykcolor etc. if so then you should wrap those too. Be careful with this stuff.
Please note it is not enough to define all gray as 0.5 since someone might be painting white to fill areas so that has to be accounted for too.
Ammendum: you could also just define the setgray inisde the /ostate save def and ostate restore directives then you don't need to separately unload the functionality.