Here’s something most folks don’t know about digital cameras: in terms of a quality, well-resolved photograph, you should stay away from the smaller apertures. F22 is too small.
If you’re fortunate enough to have a full-frame sensor camera (such as the Nikon D3/D700 or Canon EOS 5D, for example) you can go to about F11. With better DX (half frame sensor size) cameras, such as the Nikon D300) you can go to between 5.6 and 8; and with little consumer cameras, you should stay at f4 or 5.6.
What’s up with that recommendation? Well, it get a bit technical (see “Airy disc” online for details) but it basically comes down to the smaller the aperture, the bigger the point of light on the surface of the sensor. And if the point of light covers several “pixels” (individual sensors) you’ve lost resolving power.
Even before that happens though, you’ll start overlapping the sensors, and will end up losing contrast, which appears to the eye as a loss of resolution.
Ever wonder why your digital photos look “flat?” That’s why.
Yes – it’s a trade off between resolution and depth of field, and it’s an agonizing one. If you -need- the depth of field, and have to go above f11, you’ll lose some resolution.
A solution might be to go with a lens with a wider angle. Equally, setting your zoom to the wider end of the scale will open up the aperture on many lenses.
If you’re a photographer, you owe it to yourself to run a few tests to confirm how this affects your particular setup.
Meanwhile, (and this is a generalization, varying by sensor size/density, but the gist is correct:) just remember that you’ll get sharper photos at around f5.6 than you will at f22 with your digital camera; that your sweet-spots are between f4 and f8.