If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Depth of field

In this video we'll explore why regions in our scenes can go "out of focus." The region of our scene which is in focus call depth of field..

Want to join the conversation?

  • piceratops tree style avatar for user Lucy
    At what movie is the girl from?
    (0 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user Naveen KURUBA
    What is the meaning of focus at infinity? I observed that when focus slider is set to INFINITY, pizza is blurred. How this can be explained mathematically?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Yashas
    Why cant we have focus from far places
    (2 votes)
    Default Khan Academy avatar avatar for user
  • winston default style avatar for user Haleema
    At what causes the rays to fan out?
    Is it because we are focusing on one part of the whole image?
    If the whole scene is in focus, will all the rays be parallel?
    What do they mean hitting the lens at an angle?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • mr pants teal style avatar for user Bella
    how do I become an animater
    (2 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user Lalisa
    What was it again? I...just don't understand really much.🙀
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user hcps-copelandd
    How can you use depth of field?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user rho6621
    - In the previous video, we saw
    how lenses can focus parallel light rays
    to a point on our image plane,
    resulting in a sharp image.
    This means that if our image plane
    is set at the focal length of our lens,
    then objects that are very far away appear sharp.
    For example, imagine a scene with Joy
    standing a mile away from the camera, like this.
    If we look at the scene from the side, we get this.
    Notice the light rays that bounce off Joy
    and enter the camera are approximately parallel.
    If we place our image plane
    at the focal length of the lens,
    Joy will be in focus.
    But what happens when we try and make an image
    of nearby objects in our scene?
    Imagine we move the camera so that Joy
    is standing just a few feet away.
    Now pick any point on Joy and look at
    the light rays that are heading from that point
    toward the lens of our camera.
    Notice that these light rays aren't parallel,
    they fan out.
    Because they're hitting the lens at an angle,
    they are redirected to a point
    a little farther away behind the image plane.
    Over here.
    And where the light rays actually
    hit the image plane,
    they're spread out in larger circles
    instead of tiny points.
    This results in an image of Joy
    which is out of focus.
    To see this effect clearly,
    check out this out of focus shot of lights.
    These blurry circles are known as Circles of Confusion.
    They're a result of light rays
    which haven't been focused to a point
    on the image plane.
    And when an image is in focus,
    the circles of confusion are so small,
    they appear as points in our image.
    We can bring Joy into focus
    by moving the image plane back a little.
    There.
    At this distance, Joy will be in sharp focus.
    Remember with our pinhole camera
    just the size of the pinhole
    determined how blurry or sharp
    everything in our image was.
    And with a tiny pinhole,
    the entire scene was in focus.
    But now, with a lens in there,
    only a slice of our scene will be in focus.
    And anything which moves outside
    of this in-focus region,
    either too close or too far away,
    will appear out of focus.
    This is known as Depth of Field.
    Filmmakers control the depth of field
    with their choice of lens
    and aperture, or F Stop.
    Let's do an example with multiple Joys
    at different distances from our camera.
    If our aperture is very small,
    that would be with a large F Stop,
    then the depth of field will be larger
    and the transition from sharp to blurry
    is very gradual.
    To see this, let's start with a subject
    that's in sharp focus.
    As I move it farther away,
    the blurry region doesn't change very much.
    This is Deep Depth of Field.
    So more than one of our Joys will be in focus.
    Now, let's increase the size of our aperture,
    that is, a smaller F Stop,
    and start again with our subject in focus.
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user rho6621
    The depth of field (DOF) is the distance between the nearest and the furthest objects that are in acceptably sharp focus in an image captured with a camera.

    Factors affecting depth of field

    Effect of aperture on blur and DOF. The points in focus (2) project points onto the image plane (5), but points at different distances (1 and 3) project blurred images, or circles of confusion. Decreasing the aperture size (4) reduces the size of the blur spots for points not in the focused plane, so that the blurring is imperceptible, and all points are within the DOF.
    For cameras that can only focus on one object distance at a time, depth of field is the distance between the nearest and the farthest objects that are in acceptably sharp focus.[1] "Acceptably sharp focus" is defined using a property called the "circle of confusion".

    The depth of field can be determined by focal length, distance to subject, the acceptable circle of confusion size, and aperture.[2] Limitations of depth of field can sometimes be overcome with various techniques and equipment. The approximate depth of field can be given by:

    DOF

    2

    2



    2
    {\displaystyle {\text{DOF}}\approx {\frac {2u^{2}Nc}{f^{2}}}}
    for a given circle of confusion (c), focal length (f), f-number (N), and distance to subject (u).[3][4]

    As distance or the size of the acceptable circle of confusion increases, the depth of field increases; however, increasing the size of the aperture or increasing the focal length reduces the depth of field. Depth of field changes linearly with F-number and circle of confusion, but changes in proportion to the square of the focal length and the distance to the subject. As a result, photos taken at extremely close range have a proportionally much smaller depth of field.

    Sensor size affects DOF in counterintuitive ways. Because the circle of confusion is directly tied to the sensor size, decreasing the size of the sensor while holding focal length and aperture constant will decrease the depth of field (by the crop factor). The resulting image however will have a different field of view. If the focal length is altered to maintain the field of view, the change in focal length will counter the decrease of DOF from the smaller sensor and increase the depth of field (also by the crop factor).[5][6][7][8]

    Effect of lens aperture
    For a given subject framing and camera position, the DOF is controlled by the lens aperture diameter, which is usually specified as the f-number (the ratio of lens focal length to aperture diameter). Reducing the aperture diameter (increasing the f-number) increases the DOF because only the light travelling at shallower angles passes through the aperture. Because the angles are shallow, the light rays are within the acceptable circle of confusion for a greater distance.[9]

    For a given size of the subject's image in the focal plane, the same f-number on any focal length lens will give the same depth of field.[10] This is evident from the DOF equation by noting that the ratio u/f is constant for constant image size. For example, if the focal length is doubled, the subject distance is also doubled to keep the subject image size the same. This observation contrasts with the common notion that "focal length is twice as important to defocus as f/stop",[11] which applies to a constant subject distance, as opposed to constant image size.

    Motion pictures make only limited use of aperture control; to produce a consistent image quality from shot to shot, cinematographers usually choose a single aperture setting for interiors and another for exteriors, and adjust exposure through the use of camera filters or light levels. Aperture settings are adjusted more frequently in still photography, where variations in depth of field are used to produce a variety of special effects.

    Aperture = f/1.4. DOF=0.8 cm

    Aperture = f/4.0. DOF=2.2 cm

    Aperture = f/22. DOF=12.4 cm
    Depth of field for different values of aperture using 50 mm objective lens and full-frame DSLR camera. Focus point is on the first blocks column.[12]
    Effect of circle of confusion
    Precise focus is only possible at an exact distance from the lens;[a] at that distance, a point object will produce a point image. Otherwise, a point object will produce a blur spot shaped like the aperture, typically and approximately a circle. When this circular spot is sufficiently small, it is visually indistinguishable from a point, and appears to be in focus. The diameter of the largest circle that is indistinguishable from a point is known as the acceptable circle of confusion, or informally, simply as the circle of confusion. Points that produce a blur spot smaller than this acceptable circle of confusion are considered acceptably sharp.

    The acceptable circle of confusion depends on how the final image will be used. It is generally accepted to be 0.25 mm for an image viewed from 25 cm away.[13]

    For 35 mm motion pictures, the image area on the film is roughly 22 mm by 16 mm. The limit of tolerable error was traditionally set at 0.05 mm (0.0020 in) diameter, while for 16 mm film, where the size is about half as large, the tolerance is stricter, 0.025 mm (0.00098 in).[14] More modern practice for 35 mm productions set the circle of confusion limit at 0.025 mm (0.00098 in).[15]
    (1 vote)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATH
    is it just me or is joy a control freak?

    I mean in the movie, she only allows happy memories
    (1 vote)
    Default Khan Academy avatar avatar for user

Video transcript

- In the previous video, we saw how lenses can focus parallel light rays to a point on our image plane, resulting in a sharp image. This means that if our image plane is set at the focal length of our lens, then objects that are very far away appear sharp. For example, imagine a scene with Joy standing a mile away from the camera, like this. If we look at the scene from the side, we get this. Notice the light rays that bounce off Joy and enter the camera are approximately parallel. If we place our image plane at the focal length of the lens, Joy will be in focus. But what happens when we try and make an image of nearby objects in our scene? Imagine we move the camera so that Joy is standing just a few feet away. Now pick any point on Joy and look at the light rays that are heading from that point toward the lens of our camera. Notice that these light rays aren't parallel, they fan out. Because they're hitting the lens at an angle, they are redirected to a point a little farther away behind the image plane. Over here. And where the light rays actually hit the image plane, they're spread out in larger circles instead of tiny points. This results in an image of Joy which is out of focus. To see this effect clearly, check out this out of focus shot of lights. These blurry circles are known as Circles of Confusion. They're a result of light rays which haven't been focused to a point on the image plane. And when an image is in focus, the circles of confusion are so small, they appear as points in our image. We can bring Joy into focus by moving the image plane back a little. There. At this distance, Joy will be in sharp focus. Remember with our pinhole camera just the size of the pinhole determined how blurry or sharp everything in our image was. And with a tiny pinhole, the entire scene was in focus. But now, with a lens in there, only a slice of our scene will be in focus. And anything which moves outside of this in-focus region, either too close or too far away, will appear out of focus. This is known as Depth of Field. Filmmakers control the depth of field with their choice of lens and aperture, or F Stop. Let's do an example with multiple Joys at different distances from our camera. If our aperture is very small, that would be with a large F Stop, then the depth of field will be larger and the transition from sharp to blurry is very gradual. To see this, let's start with a subject that's in sharp focus. As I move it farther away, the blurry region doesn't change very much. This is Deep Depth of Field. So more than one of our Joys will be in focus. Now, let's increase the size of our aperture, that is, a smaller F Stop, and start again with our subject in focus. Moving the subject even just a little further away causes the blurry region to get big fast. This is called Shallow Depth of Field. Now, just a tiny slice of our scene will be in focus. So with a small aperture, or large F Stop, the depth of field is deep. The entire scene is in focus. With a larger aperture, or smaller F Stop, the depth of field is shallow. Only a small slice of our scene is in focus. In the next exercise, you'll have the opportunity to explore how both aperture and lens length affect depth of field.