I have seen many photos which are quite sharp in the center, but soft on the edges. What is the reason for this, and how can I prevent it?
My first guess is that it has to do with the lens.
For example, this photo the center of the image is much sharper than the edges.
We would require more details on the lens you are using but if you look up the MTF chart of your lenses, it will let you know that the lens loses sharpness on the edges of the lens. a good explanation of how to read the MTF chart is in the link below. It also shows the contract quality of a lens which also plays into sharpness. I would check out your lens with with the manufacturer check to see what it set to.
The job of the camera lens is to project an image of the outside world on the flat surface of film or digital sensor. What we want is a faithful image. To achieve, the lens projects a minuscule circle of light that corresponds to a tiny point on the subject. Thus the projected image consists of a collection of points of light, each so tiny that they are seen as a dimensionless point. That portion of the image that lies at the center of the projected image has the advantage. In other words, the center of the projected image is called the “circle of good definition”. That portion of the projected image outside the boundaries of the circle of good definition is substandard.
To explain; think about a flashlight aimed straight on. You see a circle of light. If you aim the flashlight at an angle at a wall, you see an oval spot, not a circle. The oval spot of light covers more surface, meaning it is bigger. It is the size of the tiny circles of light projected by the lens that determines the perceived sharpness. It is a fact of physics that the outlying periphery of the projected image is substandard. Additionally image brightness is greatest within the circle of good declination, and it dims as the distance from center increases. This phenomenon is called a vignette.
Again the vignette is due to the light rays arriving at the edges, project an oval and not a circle. This phenomenon is called cosign error. To mitigate, it has been common practice to mount a lens with a focal length about equal to the diagonal measure of the format rectangle. Such a focal length is termed “normal” as it delivers a view that corresponds to the perspective we see with our eyes. For the full frame camera format (24mm by 36mm) this is a lens with a focal length of about 50mm. For the compact digital (16mm by 24mm) the “normal” is a lens with a focal length of 30mm.
As we mount lenses that are shorter in focal length (wide-angle), the vignette becomes more difficult to control. As we mount lenses with super wide apertures, the task of the lens maker is challenged. These difficulties are mitigated by innovative lens design. The bottom line is, when we task lenses to zoom and cover a wide range of focal length and apertures, the complications mount and the costs go up. Somewhere, the camera/lens maker must make compromises or prices go through the roof.
The faithful image has never been achieved!
Edge softness is quite common with consumer grade lenses when shooting wide open or near wide open. In most cases edge sharpness will improve by just stopping down by one or two stops.
Even some "Pro" grade lenses can have soft corners and again the easy solution is to just stop down a little.
While it is true that most lenses perform better in the center than at the edges and in the corners, this isn't the main contributing factor to why the image you linked as an example is much softer in the corners than at the center.
The reason the tree branches are so much softer than the rest of the photo is because they are much closer to the camera than the parts of the scene in the center. The lens was focused on the more distant parts of the scene that occupy the center of the photo. The tree branches are thus well outside the Depth of Field of the selected aperture and focus distance! Even if the close tree branches were in the very center of the framing, as long as the focus distance is set to the far more distant objects, the tree branches will be blurry and out of focus.
Besides the character of the lens, setting aperture(f) parameter to a higher value produces sharper edges. For many lenses sharpest aperture of the lens is about f/7 - f/8. Since using the highest aperture value will significantly reduce the light captured, it's important to determine the peak sharpest aperture of your lens.I personally prefer to do some trials when I first buy a lens. I shoot pics using a tripod and compare the results afterwards.
As others pointed out, the image quality is usually better at the center due to the lens. But that would give just a few pixels of blur. The image you link to is different:
It is not just "not very sharp", but really blurry.
If you look closely, it is rather clearly a motion blur. Take for example the lights on the left: . It looks like there are two samples of the same images superimposed and slightly shifted. This typically happens if you have a long exposure, and do a slight move in the middle.
My bet is that the camera was slightly rotated in the middle of the exposure. The rotation is centered in the middle of the image, hence the effect is more visible at the borders.
I just did a procedure to test the effect of aperture setting on blur toward the edges of digital photographs. Using a Nikon D810 and a Nikkor AF-S 70-200 ED, F2.8 on a tripod using a remote control to eliminate any blur due to lens motion, I took a series of photographs at 200MM focal length varying the aperture from 2.8 to 22. There is a very noticeable difference in edge blurring that decreases as the F-stop number increases. This seems to confirm earlier statements that stopping down will help reduce edge blurring, though it was never totally eliminated. I used a constant ISO 1000 so I have not tested any effect of ISO or shutter speed on the problem. Maybe some time soon.
Nearly all lenses are softer at the edges than the center. On a poor lens though, the difference is huge. On a good lens, it can be much lower and professional grade ones show almost no degradation near edges. The best way to visualize this is by looking at Lens Reviews at Imaging Resource (Previously at SLR Gear). As a completely random example, here is the Sigma 24-35mm F/2. You can play with the aperture and focal-lengh to visualize the lens softness over the sensor area.
The first solution is to stop down. Most lenses improve as the aperture gets smaller. A really good lens will improve less because it will already have good edge sharpness. Poor lenses can sharpen up two or even three stops down but may never get acceptably sharp. Eventually you will hit diffraction but it will affect the whole image plane, not just edges.
The second solution is to get a better lens. Reviews and tests are a good way to find out which lens is better because price is not completely related. You can double the cost of a lens without getting any improvement just as easily as you can get a much better lens. Look at MFT Charts to understand the sharpness of the lens but keep in mind that the ones published by a manufacturer are often based on an ideal model and there are often sample variations.