Given that the Nikon D3200 has a 24.1 megapixel sensor, how do I get the most out of those pixels? In particular, what is the sharpest aperture for the Sigma 10-20mm?
1. Background
The Nikon D3200 is a very advanced camera. With a 24.1 megapixel sensor producing images 6016 pixels wide by 4000 pixels tall, it is also slightly frightening. As I wrote almost two years ago on the topic of camera technique: No matter how advanced a camera is, there tends to be a certain way it must be handled to produce optimal results, for any definition of optimal. "Getting to know the camera" is very much a process of mapping out this parameter space. With the Nikon D40 it took me over a hundred shots before I could reliably produce the exposure I wanted. With the D3200 it was the same.
Image quality is a very subjective topic, but in general it amounts to making the camera do what you want it to. Now, "sharpness" is a quality of photos that I think is discussed and measured to death by idiots in forums. Let me therefore clarify: Discussing and measuring it to death is bad, but knowing the optimal aperture for sharpness of your camera / lens combo is good. The former takes a lifetime of angry posts and leads nowhere, but the latter takes about an hour and gives you good information that will last for the lifetime of the camera and lens.
Sharpness is usually most important when doing landscape photography, and my workhorse lens for that is the Sigma 10-20mm / f4-5.6. I usually shoot it at 10mm focused at infinity, but when doing VR panoramas I sometimes switch to 20mm for the shots along the horizon. I also shoot flowers and stuff like that close-up at 10mm. Therefore I wanted to find the optimal aperture for the following scenarios:
10mm, subject far away
10mm, subject close
20mm, subject far away
I set up the test, took the shots, and here are the results:
2. Results
2.1. Executive Summary
At 10mm, the best near-distance sharpness was achieved at f/10 and the best far-distance sharpness was achieved at f/7.1. At 20mm, the best far-distance sharpness was achieved at f/10.
2.2. Longer Summary
This is the test scene. The large and small green rectangles are the areas used for local contrast computation. The contrast values for the outer rectangle are listed as "Large Area" and the contrast values for the small area are listed as "Small Area". See §3. Method for a detailed description.
Here are the contrast values for the areas plotted against lens aperture. Don't compare the left and right axis values - they are not comparable. See §4. Data for the raw data.
The diagrams are very abstract, so let me illustrate the difference between f/4 (almost the worst) and f/7.1 (the best). Let's look at a 60 by 60 pixel square enlarged to 400%. We'll take it from slightly above the center of the image.
Here it is. Click on the "f/7.1" below the image or roll over to see the difference.
Here's another sample area, this time only at optimal sharpness. As you can see, we're getting just about 24 megapixels's worth of actual image.
3. Method
The sharpness is calculated as the sum of the contrast in the sum of all three color channels of a FINE JPEG photo. First all color channels are added. Then contrast is the sum of the contrasts in the neighborhoods of each pixel in the focus test area. The contrast in the neighborhood of a pixel is defined as the sum of the squares of the difference of the value of the pixel and the value of the neighboring pixels. As neighboring pixels we count the four pixels to the left, right above and below. In pseudo-code:
ImageChannel gray = red + green + blue;
long contrast = 0;
for (each pixel x,y in the test area) {
long localContrast = 0;
// left
localContrast +=
square( gray(x,y) - gray(x - 1, y) );
// right
localContrast +=
square( gray(x,y) - gray(x + 1, y) );
// above
localContrast +=
square( gray(x,y) - gray(x, y - 1) );
// below
localContrast +=
square( gray(x,y) - gray(x, y + 1) );
contrast += localContrast;
}
return contrast;
This means that image noise is included in the contrast calculation. However, as the image noise is unaffected by aperture, this will cancel out. JPEG compression artifacts are much smaller than the image edges, and the squaring of the differences guarantee that they will remain too small to affect the test results.
4. Data
Here is the raw data for the diagrams. Each row in a table represents a single photo. The total score for each f-number is the sum of contrast values for photos with that f-number.
f-number | Contrast |
---|---|
10 | 1473472586 |
11 | 1448089433 |
10 | 1429158060 |
9 | 1409085413 |
9 | 1393520483 |
11 | 1370859050 |
8 | 1288059419 |
8 | 1258286169 |
7.1 | 1102239095 |
7.1 | 1040928766 |
6.3 | 931812825 |
6.3 | 920802883 |
5.6 | 751291320 |
5.6 | 714257715 |
5 | 572115763 |
5 | 534129334 |
4.5 | 460484983 |
4.5 | 431817600 |
4 | 388591946 |
4 | 354472747 |
4 | 352543342 |
f-number | Contrast |
---|---|
10 | 26491725 |
10 | 25673471 |
11 | 25528584 |
9 | 25269181 |
9 | 24931162 |
11 | 24361075 |
8 | 22523498 |
8 | 22390356 |
7.1 | 19149487 |
7.1 | 18762605 |
6.3 | 15897082 |
6.3 | 15867621 |
5.6 | 13169796 |
5.6 | 12826077 |
5 | 10958649 |
5 | 10651488 |
4.5 | 9643050 |
4.5 | 9579383 |
4 | 8185206 |
4 | 7226068 |
4 | 7096176 |
f-number | Contrast |
---|---|
7.1 | 1365777217 |
7.1 | 1294214204 |
8 | 1251169880 |
8 | 1144173812 |
6.3 | 1138479783 |
6.3 | 1112244942 |
9 | 1052372584 |
5.6 | 995958084 |
5.6 | 985868637 |
9 | 951613872 |
10 | 910765216 |
11 | 854693277 |
10 | 853995877 |
13 | 837169762 |
11 | 833494018 |
5 | 827627700 |
5 | 818899814 |
13 | 810064611 |
4.5 | 723018625 |
4.5 | 718831094 |
4 | 614740719 |
4 | 603907103 |
f-number | Contrast |
---|---|
7.1 | 5126870 |
8 | 4829496 |
7.1 | 4718426 |
9 | 4564463 |
8 | 4317265 |
10 | 3969488 |
9 | 3870154 |
6.3 | 3839366 |
4.5 | 3662542 |
11 | 3606362 |
10 | 3597535 |
13 | 3595812 |
6.3 | 3554724 |
5.6 | 3503059 |
11 | 3408462 |
5.6 | 3389681 |
13 | 3349138 |
5 | 3272568 |
4.5 | 3270652 |
5 | 3216864 |
4 | 3115018 |
4 | 2898726 |
f-number | Contrast |
---|---|
10 | 1754731081 |
11 | 1576525091 |
13 | 1491058391 |
8 | 1382651841 |
9 | 1375091782 |
14 | 1359707701 |
5.6 | 1228758086 |
6.3 | 1137003059 |
7.1 | 981308428 |