There is a way this can be done, and it’s a standard technique in 3D computer animation programs, but it requires a specially constructed image, and there are some severe limitations.
This works by taking a grey scale image and using the value (i.e. the colour from black to white) to generate the 3rd dimension. Normally this is done to add detail to a 3D model for rendering as an image, e.g. pores in skin, textures of brick, woodgrain, etc.
The grey scale images are called bump maps or displacement maps (I won’t go into the difference here, but you want the displacement version).
Blender – the free, open source animation program (https://www.blender.org/), can export .stl files, and I think you may be able to export a displacement mapped object to produce a ‘real’ 3D printed version.
But this only will only work for some objects – it cannot produce undercuts for instance, and the level of detail may be too low to be useable. For their intended purpose, a photograph of the real object may be good enough, see the head on the glass of beer below:


But this may not be what you want.
You can see, if you look carefully, that the dark areas on the top photo are rendered as low points e.g. the largest bubble appears as a crater – this could have been prevented by inverting the image (white is rendered as the high points), but I guess I was in a hurry at the time.