Hello everyone,
this is a Node setup to map the Z values in a grayscale image
this is really useful when you have an external compositor or
when you work on high rendertimes, you often realise that
you need to re-render your entire shot because you failed
the post effects, whith this node setup you can use this grayscale
image to make DOF (deph of field) effects, mist, and some orther cool
things with compositing softwares.
released under CC0- (Do what you want !) (feel free to give attribution).
I don't know too much about compositing, but can't you just turn on the Z pass in the render layers? It makes a depth pass for me.