You can just plug a heightfield generate into your tree where you want to sample the heightmap, set number of points (pixels in the image) and the size of terrain to be sampled.
Hit Generate Now then right click on the node as Save as.. to Open Exr.
You've now got a map that can be used for displacement in most 3d apps.
If you load it into Photoshop it will invariably be completely white (unless you've rendered a flat terrain at sea level!) as all values will be over 1.
If you then convert to 8 bit it will normalize the image squeezing the low and high values into 0-1 range (or in Photoshop 8 bitness 0-255) and you'll see the contours of your terrain.
I'm not a Photoshop expert, but it looks like if you choose Equalise Histogram when you convert to an 8-bit image it will normalize the 32-bit image correctly.