# How can a smartphone take pictures of a landscape with everything in focus?

After the announcement of the new Samsung Galaxy S9 with the new camera that changes aperture, I caught myself wondering: if smartphones have such a wide aperture (f/2.8, f/2.2, etc), how are smartphones able to take landscape pictures, making everything in sharp focus with a fixed wide aperture? As far as my knowledge goes, it's necessary to use a smaller aperture (f/5.6, f/7, etc) to get a wider depth of field, and put all the landscape within focus. How do smartphones manage to accomplish that with a fixed wide aperture?

• Possible duplicate of How can a super tiny iPhone 6 Plus lens produce significant DOF? Commented Mar 15, 2018 at 19:18
• Except the possible duplicate actually means "shallow DoF" when it says "significant DoF." Apparently the OP thinks DoF is the blur. Commented Mar 26, 2018 at 2:32

It's worth noting that sensor size plays a huge role in depth of field and behavior of the lens.

A smartphone has a tiny camera sensor, often around 25 square mm. This gives the camera a crop factor of about 6. (For the Samsung S9, I'm not sure about the dimensions.)

You can calculate the hyperfocal distance (or "depth of field") but you can also get a pretty good estimate by multiplying the f/ number by the crop factor to know what your effective f stop is. On a sensor of roughly 25 square mm, your F/2.2 behaves a lot like a f/13.2 aperture lens would on full frame.

• even more correctly, remember that the / character in lens designations not only looks like a division - it literally is division. for a typical f=50 mm lens, f/10 means 5 mm aperture, while a f/2 smartphone having 4 mm focal length only has 2 mm aperture. so in this example, the smartphone aperture is actually smaller and the depth of field is bigger. Commented Mar 9, 2018 at 17:19
• It's the much shorter focal length needed to get the wide angled view with the smaller sensor that makes the difference, not the sensor size itself. Commented Mar 10, 2018 at 4:00

If by "landscape" you mean something like this:

then the answer is simple: at very large distances, depth of field is extremely large even at large apertures. That is, at any aperture if you focus at infinity, objects 20m, 200m, and 2000m from you will be sharp.

However, focal length of the lens also influences depth of field, see answers below. Smaller sensors will have shorter lenses. You should also read "what exactly determines depth of field"

• "That is, at any aperture if you focus at infinity, objects 20m, 200m, and 2000m from you will be sharp." That simply isn't true. For example, if you put a 50mm f/1.4 lens on a Canon 1D mk IV, DOFmaster reports a hyperfocal distance of 76.9m: one consequence of that is that nothing closer than 76.9m will be in acceptable focus if you focus at infinity. DOF depends on more than just aperture. Commented Mar 9, 2018 at 18:30
• This shouldn't be the accepted answer.
– Reid
Commented Mar 9, 2018 at 23:10
• @DavidRicherby What in the scene is closer to the camera than 80 meters in the example image? Beyond that, the camera in question is not a FF camera with a 50mm f/1.4 lens, it is a smart phone with a very small sensor and an approximate focal length of 3-4mm. Commented Mar 10, 2018 at 4:02
• @DavidRicherby that's why i posted link to larger discussion Commented Mar 10, 2018 at 7:14
• @MichaelClark The sentence I quoted has no "in certain situations" disclaimer, so it's supposed to be true in all situations. The answer claims that even if there was something in that frame 20m from the camera, that thing would be in focus. The style in which the answer is written suggests that it refers to all cameras (e.g., the linked answer is about DoF in general). I agree that it's probably true when restricted to smart phone cameras and I'd be happy if the answer made that explicit. Commented Mar 10, 2018 at 9:59

Aperture is only one factor in depth of field. Others are: sensor size and focal length. Large format camera lenses often have max apertures in f/4-f/5 range, yet they yield very shallow DOF - because both photosensitive element is huge and focal length is long (at comparable angle of view to a 35mm camera).

Phone cameras have tiny sensors and short focal lengths (like 26mm for the S8) to compensate. Even if you mount a 28mm lens on a DSLR, it's "infinity" starts at about 0.5-1m for lenses that short. So, once you set focus there, everything from 1m to actual infinity is in focus, making sharp landscapes a breeze.

Rule of thumb is: the smaller the camera, the larger the depth of field. That's why cool effects, like background separation, are very hard to achieve on phones.

/edit: As @hobbs noted, what we everyday call "aperture" is in fact relative aperture. Absolute aperture (entrance pupil) is the actual size of the "hole" you perceive when looking into the lens. User @Nayuki wrote a nice article about how relative and absolute apertures are related to focal length and mentioned in his answer.

You can easily compare it yourself - looking into lens of your phone you can easily see that its ~F/2 aperture is only 2-3mm wide, while a typical 35mm F/2.8 lens is that small when fully stepped down and when opened (you can hold DOF preview button for that) is at least a cm wide.

• There's pretty much only one factor, and that's absolute aperture (aka entrance pupil diameter). f-number (relative aperture) is ubiquitous because it's useful for calculating exposure, but it's not "the aperture", it's the ratio of aperture to focal length. Everything else that depends on aperture (like DoF, diffraction, and total light gathering as a predictor of overall image quality) doesn't care about the f-number, but depends directly on the size of the aperture as seen from the front of the lens. That's why people get into so much confusion trying to compare f/apples to f/oranges. Commented Mar 9, 2018 at 22:14
• @hobbs Diffraction depends on actual physical diaphragm characteristics, not entrance pupil. When you use refractive lenses to funnel light down through the actual hole in the aperture diaphragm, the light waves don't oscillate with a smaller amplitude, they just oscillate at the same amplitude closer to the other light waves. Commented Mar 12, 2018 at 13:21
• @MichaelClark true. Commented Mar 12, 2018 at 14:22
• @hobbs I've added a paragraph about absolute aperture Commented Mar 15, 2018 at 19:20