Jorge, great advice from LL617.
"Stopping down" to a very small aperture (high number) will give the maximum "depth of field" as measured from near to far spots on your image that are in focus. Heck, I've got an old medium format film camera with an f-stop (aperture) adjustment of a whopping 45!
This is extremely critical with doing close-up, table top and macro photography . . . because the in focus depth becomes very, very shallow indeed!
A NEW TWIST . . . (I'm trying to take do this in little chunks)
"THE RULE OF THIRDS" as it relates to maximizing accurate depth of field
In photography school they teach this concept, that for a given aperture setting, lens and distance from an object that a certain depth of field will be acceptably sharp (in focus).
Basically, the higher the f-stop (aperture) number, the greater the depth of field! Here's where the rule of thirds comes in . . .
Divide the distance that is acceptably sharp by three, then precisely focus your camera for a spot that's 1/3 of the way into that sharp zone. For instance, if the sharp depth of field is 9," focus 3" into the area you want to be razor sharp . . . and all 9" of that area will be sharp!
Yes, there are charts out there that can tell you the depth of field for all the aperture settings!
HOW IT CAN BENEFIT YOU SHOOTING GUNS . . .
The sharp range, using a very high number aperture to shoot a handgun is very, very limited . . . mere inches.
1. IF you were to focus on the front of the handgun itself, at its closest point to your lens, the in-focus area would start well in front of the object, yet get blurry on the furthest part of the gun.
2. So, measure the distance on the gun that must be kept sharp, divide the distance by three and focus 1/3rd of the way into that zone!
In this example, I desired to have the leading edge, back to about the front of the cylinder in focus, and I did NOT want the trailing away barrel to be sharp. So, I measured and determined to precisely focus on the S&W seal on the gun's wooden grip . . . and this accomplished exactly what I wanted.
CLICK ON IMAGE FOR A GREATER ENLARGEMENT . . .
3. IF the front edge of the gun is not sharp the depth of field at that range is not sufficient to keep the gun sharp from front to back. If this happens, focus further to the front of the object!
NO . . . they don't tell you this in manuals that come with most cameras . . . its a technique only important to photographers desiring to control what is sharp on the image and what becomes blurry.
BY THE SAME TOKEN, photographers intentionally use LARGE, wide-open aperture settings (low aperture number, i.e.: 2.8 or lower) sometimes to intentionally blur the background to highlight an object in the forefront.
Something like this . . . TOTALLY different aperture settings to achieve different results with varying amount of out-of-focus elements in the background that will highlight what I'm trying to accomplish!
or this . . .
Yep, I use "P" for Program on snapshots too . . . but when I have a little time to think, I'm taking control from the little computer in the camera that doesn't know what I'm trying to create. You can learn this too, Jorge!
Hope this helps . . .