I have a Nikon D40. It has only 6.1 MP. I am planning to buy additional lens for it. Can changing the lens of the camera increase or decrease the megapixels of the camera?

  • What is more likely to affect the quality of the image and the reproduction of it is what quality/resolution setting you use. If you don't use the highest quality, then the image quality will suffer. Some people prefer to shoot in RAW mode. Some cameras will save both RAW, and a processed JPG file to give lots of flexibility. Another issue is with file importers. I've seen many a program automatically import photos and then scale them down so that they are smaller. Lots of things are likely to affect the end result, the lens is the least likely.
    – MikeP
    Jan 10, 2017 at 16:49

6 Answers 6


The number of megapixels of a camera is determined by the resolution of the camera's sensor, which is part of the camera body. It cannot be altered by a lens.

  • 1
    +1 True. But in a larger sense, the number of pixels can effectively be reduced, such as when lenses designed for smaller sensors are mounted and extreme vignetting occurs. The D40 has a full size sensor (24 x 16 mm), which makes such a scenario plausible (but I don't know whether it's actually possible: that depends on lens mount compatibilities).
    – whuber
    Jan 23, 2012 at 23:02
  • 1
    @whuber: What exactly do you mean by "full size" sensor? I don't read that to mean "full frame" sensor...but I'm not really sure exactly what it means. Its still an APS-C sensor, correct? The only time APS-C sensor sizes change, as far as I know, is when you change brands...Nikon APS-C is always the same size amongst Nikon, but different than Canon APS-C size.
    – jrista
    Jan 23, 2012 at 23:22
  • This answer is true but unhelpful. I'm reminded of the joke about the engineer and the hot air balloon.
    – mattdm
    Jan 24, 2012 at 1:03
  • @jr I mean in a practical sense as implied by the context: cameras tend to come in product lines which frequently share many lenses, but whose sensors may differ in dimensions (as well as pixel size). A lens will usually create an image within a circle beyond which there is severe light falloff. In some camera lines it is possible to mount a lens designed for a physically smaller sensor on a camera having one of the larger sensors for that line: this is the sense of "full size." In these situations the lens can work effectively but the image it makes will not cover the entire sensor.
    – whuber
    Jan 24, 2012 at 5:24
  • @whuber if you call APS-C in Nikon F-mount line "full size", what would the full-frame sensor of D3 and D700 (where you can also mount DX lenses) be called?
    – Imre
    Jan 24, 2012 at 8:20

As @ahockley said, the resolution (number of megapixels) is determined primarily by the sensor, so changing the lens doesn't change it.

Being fair, the resolution of the sensor is basically the theoretical maximum of which the system as a whole is capable. Although a better lens can't increase it, a really poor quality lens could reduce the effective resolution below that. In your case, however, that's fairly unlikely short of using a really poor quality lens. The reason for this is fairly simple: most lens designs can easily produce an image of higher resolution than the sensor you're using.

The times you could run into resolution limitations from the lens would be with a really low-end, off-brand lens -- if somebody's offering a 500mm lens for $50, chances are pretty good that it will be the limit on resolution. Likewise, if you hook the camera up to a low-end telescope or microscope, something in some other mount (e.g., C-mount) that was never designed for that size of sensor. That generally won't happen by accident though -- you'll generally have to find and such adapters to mount them on the camera at all.

A reasonably recent, undamaged lens from Nikon or any of the reasonably reputable 3rd party vendors like Sigma, Tamron, or Tokina shouldn't have much difficulty producing pictures at the full resolution of the sensor.

Though it doesn't apply in this specific case, there is one circumstance under which changing the lens can change the actual number of megapixels produced by the camera. In some cases, you can mount an APS-C lens on a full-frame camera, and when you do the camera will sense the lens you're using, and only use the part of the sensor that corresponds to APS-C framing. In this case, the actual sensed resolution is reduced.

To give a concrete example of that, I have a Sony Alpha 900 (full-frame) camera, and an 11-18mm APS-C lens. Although the camera's native resolution is ~24 MP (roughly 6000x4000 pixels), when I mount the 11-18 lens, the camera produces ~12 MP pictures (roughly 4200x2800 pixels). This is not, however, from the camera sensing the maximum resolution of which the lens is capable and acting accordingly. Rather, it's a simple matter of the lens having some memory on board that tells the camera it's an APS-C lens, so the camera acts based on that. Just for example, the particular lens I'm talking about was actually made by Tamron, and repackaged/sold by Konica-Minolta. The nearly identical lens that was sold under the Tamron name didn't have the same memory on it, so one of them mounted to the same camera will produce full-frame pictures (though the image circle is small enough that you get obvious vignetting from 11 to about 14 mm).

  • 2
    A poor lens or too small a lens light circle still won't impact the CAMERA megapixels, but may impact the effective IMAGE megapixels.
    – cmason
    Jan 24, 2012 at 18:03
  • @cmason, True. Pedantic, but true. The outcome - the reproduction - is the same.
    – MikeP
    Jan 10, 2017 at 16:46

No, it does not. The resolution is a characteristic of the camera body and does not change with the lens.

However, there is one exception (which does not apply to you, since the Nikon D40 is a DX-format camera): if you mount an APS-C or DX format lens onto a full-frame or FX-format camera, the pixels outside the APS-C or DX area may not be usable due to vignetting, resulting to a loss of resolution due to cropping. On Nikon, it is possible to force FX format image capture with a DX-format lens, but this often results in severe vignetting that will force you to crop to a smaller image. On Sony, unless you are using a third-party lens, this is not an option and the 24-megapixel sensor on the A900 and A850 will be limited to the 11-megapixel APS-C crop area.


The part of your camera that will determine the number of megapixels is the sensor. You can think of this as a grid of pixels with the same dimensions as your cameras resolution. Your camera has a resolution of 3008 x 2000, So that's a grid with 3008 columns and 2000 rows (3008*2000 = 6016000 pixels, or approximately 6 megapixels). Each section of the grid (each pixel) records a value and saves it.

In order to lower the resolution your camera can throw away the data from some of the pixels on the outside. You could also use an algorithm to compress the image to a smaller size by doing something like replacing sections of pixels with the average values for those pixels. The first method would crop the outside of the image, while the second image will keep about the same overall image, but with a loss of detail.

Raising resolution is much harder. When we lower resolution we are just throwing away information we don't want anymore. In order to raise the resolution we need more information for the extra pixels we're adding. Advanced methods for this will do something of a best guess at what detail might have been there based on patterns in the image. Simpler methods will just take each pixel and spread it around, without actually adding any detail to the image.

The job of the lens is just to focus light onto the sensor. Better lenses do better jobs at providing the sensor with a crisp image. In the end though, the sensor will always chop it up into the same number of pixels.


An old thread I know, but maybe can help someone in the future.

The wider the lens, the less pixels available to cover an area.

For example, if you took a picture with a 50mm lens of say a person, you would use the majority of the pixels to render that person. From the same position and photographing the same subject with say a 24mm lens, you would now have that person covered by only 1/3 to 1/4 of the amount of pixels.

I do a lot of fine art landscape work and for the above reason I generally use a narrower lens, take multiple shots and stitch together.

  • 1
    As well, using the same lens but increasing the distance between the camera and the person will reduce the number of pixels used to cover the person. But neither that nor switching lenses has any bearing on the resolution of the recorded image, which is what the OP asked about.
    – Caleb
    May 7, 2018 at 11:49
  • This might tangentially touch on the concern of the OP (since they do seem interested in the impact of a lens on detail captured, but it doesn't really answer the question as they asked it (even if it is likely it helps answer what they meaningfully want to know). If you could add some explanation of how this relates to the question as asked, it would greatly improve the answer and help clarify for any that are confused about the difference between resolution and the size of details that are captured..
    – AJ Henderson
    May 7, 2018 at 14:37

a lot of incomplete answers here. resolution in maths terms, the lens don't make difference. resolution in quality terms, BIG YES!

  • "a lot of incomplete answers here", but yours is the most incomplete.
    – scottbb
    Dec 26, 2021 at 4:22
  • Also kind of ambigous: A lens can perfectly be resolution limited. But even if you shot the camera without a lens attached (provided approriate camera settings), the number of megapixels read from the sensor and processed into an image file will not change even by a single pixel. To add to the confusion, industrial/CCTV/TV lenses commonly have their resolution rated in megapixels (but not lenses for photo/video hand cameras). Dec 28, 2021 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.