Introduction: How to Create One Completely Focused Image From Several Partially Focused

I suggest to use Helicon Focus software. Windows and Mac versions are available at d-Stidio's site
The program is designed for macrophotography, microphotography and hyperfocal landscape photography to cope with the shallow depth-of-field problem.
Helicon Focus also aligns images as objects often change their size and position from shot to shot. This function is especially important for macrophotography.

Step 1: Creating Stack of Images

You are supposed to work with an optical microscope and a digital camera, or with additional macrolens on digital camera.

- Set your digital camera to manual focusing mode(!!) and set the focus to infinity.
- Manual mode (shutter speed and exposure) is also preferable to avoid fluctuation of brightness.
- Adjust the microscope to make the topmost area of the object sharp.
- Take a shot. Use the remote control (if available) to minimize any shaking of the camera.
- Using the fine adjustment controls, the shift sharp area a little down.
- Take a shot.
- Use small, roughly regular steps while adjusting the mircoscope and taking shots. It is better when sharp areas overlap.
- Take shots until you reach the lowest area of the scene.
- Copy images from the camera to your computer.

Step 2: Loading Images to Helicon Focus

- Start Helicon Focus.
- Add files with File->Add new item(s) command or by drag-n-drop.

Helicon Focus supports JPEG, TIFF, BMP, PSD and various RAW formats with 8 and 16 bits per channel.

Step 3: Combining Images

Run calculation with Render button.
Review the resulting image, run again with new parameters if needed.

Step 4: Saving the Output File

- Click on the image in the output list you want to save, then use the menu command File\Save, toolbar icon or hotkey Command-S.
- In the save dialog select the file format (JPEG, BMP, TIFF, JPEG2000, PSD) and set the name of the output file.

If the input files have 16 bit per channel, then output TIFF will also be written with 16 bit quality.