Microscope-PiCam is a free open-source web-based solution that acts as the soul of a Raspberry Pi based microscope.
It is an ideal solution for taking still images using a 12 MP HQ camera attached to a gemmological microscope.
The project has detailed instructions on how to setup your Raspberry Pi