In macro photography, you photograph small subjects very closely. The magnification factor then runs approximately to 1:1, i.e. the image on the sensor is about the same size as the subject itself.
The photo of the beetle is an example of a macro photo. This photo is made with a special macro lens that makes it possible to focus very close.
If you want to take pictures of even smaller subjects, you come into the field of 'extreme macro photography'. The magnification starts at 1:1 and can go up to 10:1 and higher. This can hardly be achieved with a normal camera lens.
The picture of the head of a house fly is an example of this. The head is less than 2 mm in size. The sensor of the camera used (Sony a6300) is 23.6 x 15.7 mm, so the magnification is approx. 8:1. And when printing the photo, the magnification would become a lot higher.
There are actually no good camera lenses available that can achieve this magnification. For this reason it is necessary to use a microscope objective. The objective is mounted on a telephoto lens.
Because the distance between the lens and the subject is very small, and you quickly suffer from motion blur, the camera must stand on a tripod.
If you take photos in this way, it appears that the depth of field is incredibly small. Only that part where you focus is really sharp, everything that is before and behind is not. Getting the whole subject into focus in one photo is impossible. On the left picture only a part of the antennas is sharp, on the right picture only a part of the head.
To get a picture of the subject that is sharp from the front to the back, a special technique is needed, called 'focus stacking'. This literally means 'stacking of focus points'.
You then make a series of photos in which the camera is always moved a small distance. In this way you scan the subject from front to back (or vice versa). Then special software is needed to join the sharp parts of the photos together. Depending on the size of the subject and the enlargement, 20 to more than 400 photos are needed to get one sharp image.
The camera is mounted on a threaded shaft (spindle) and is moved back and forth by a stepper motor that can be controlled very accurately. The stepper motor is the black block on the right of the picture. With this device the camera can be moved in steps of 1 micrometer (= 1/1000 mm). A step size of 10 to 50 micrometers is usually sufficient.
The black device with the switches contains the electronics and software that controls the stepper motor. And automatically makes a next photo after each move. At the top of the photo a softbox is visible with 4 studio lamps of 135 W. Focus stacking requires a lot of soft light.
The subject (a small beetle) is attached to a magnetic holder standing on a 3D cross table. This allows the subject to be moved a little bit in all directions.
The black cloth on the left is the background.
Google for 'extreme macro' and 'focus stacking' for more info!