Instead of trying to draw a depthmap, why not generate one from 3-D?
- Download Blender at https://www.blender.org
- Open ObjectToDepthmap.blend
Note: Do NOT move the camera
- Get any desired 3-D model and import it into Blender
- Go to Properties Screen->Material
- Set the Material to "F Z-Dist"
- Go to the 3-D View screen
- Set Viewport Shading to "Material"
-
In the Outliner screen, select your object
-
Go to the Node Editor screen
-
Fiddle with the Add and Multiply values until:
- The furthest visible point is not black, but close, and
- The closest visible point is not white, but close
Note: the Multiply value should always be negative
- In the Info toolbar, click Render->Render Image
- In the UV/Image Editor toolbar that pops up, click Image->Save as image
- Save your image anywhere
- Open your favourite image editing software and crop the image to the desired area
- Save the modified image
Now point PyStereogram.py towards your image, then look in the Output/
folder for your new image!