Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Dirty lens article (kurtmunger.com)
164 points by pmoriarty on Jan 31, 2015 | hide | past | favorite | 34 comments


Long time since I did any optics but this basically just convolution. The impact at the output plane of dust/imperfections on the lens is (approximately) a 2D fourier transform of the dust/imperfections. If you have a single dust particle (essentially an impulse) on the lens this will be convolved into a dc response at the focal plane.

[1] http://en.wikipedia.org/wiki/Fourier_optics#Fourier_transfor...


It's approx. convolution and the impulse response varies with the distance to focal plane: at focal plane it's impulsive but near the lens it's quite flat (almost DC -- it's simply a "zoomed in" aperture, which is a big circle usually).


The wider the lens, the more dust on the front element affects the picture. Especially specular light (bright light sources, especially the sun).

If you have a very wide-angle or fisheye lens (e.g. gopro) then you will most certainly have lots of nastiness in your photo from having a dirty lens.

You'll notice that in this person's test shots, he has no specular light or sunlight in the images. If he did, the test would have had completely different results.

If you have a gopro, try it yourself. Have a dusty or greasy lens and take a picture with/without the sun in it and the photo will certainly be worse.

Same with my mobile phone - if the front glass is greasy, well, of course the photo looks much, much worse.

I'm a professional photographer specializing in 360º imagery shot with fisheye lenses, so I know this stuff very well from experience.


Actually, the dust is more pronounced on these examples you gave (GoPro, mobile phones) because of a (pretty complicated) relation between the size of the sensor, the aperture and the depth of field, not necessarily because of the wide angle, although it exacerbates the problem.

Greasy is something else, and affects all lenses pretty much the same way, by messing with the transmittance and refraction.


Two reasons those lenses are susceptible:

- Small surface implies dirt occupies a large angular portion.

- Very small aperture (pinhole-like) focuses both near and far objects, which includes dirt.


Indeed, I ran into this today. Took the following photograph with a 28mm (wide angle) lens on a Pentax K-x DSLR (crop sensor, so 42mm equivalent) + a polarizing filter, stopped down to f/22: http://i.imgur.com/Wu7HTpo.jpg

If you look at the bottom right, you'll notice a lot of crap. It's all just dust from the filter. It's fixable in Lightroom but it's a huge pain, as I need to manually remove each speck. These dust specks did not appear when the lens was stopped to f/8-ish.

Regardless, in response to OP, I've seen some really nice photos taken with really beat-up lenses. But if you push the bounds at all and start to photograph more challenging material exposure-wise, I imagine it'll get bad real fast.


The reason why this is happening is because your entrance pupil is small (1.3mm) and close to the dust.

The crop factor is what makes things bad here: higher crop factors means that for a given field of view, the dust is closer (because the lens is thinner) and the aperture is smaller relative to the dust.

Paradoxically, the dust is actually less problematic for more challenging exposures.

You may wish to use a wider aperture, on a 28mm lens and with modern sensors, f/22 is likely to show blurring from diffraction through the small aperture. The Airy disk will have a diameter of 30 µm, but the pixel pitch on a K-x is around 5.5 µm... which means that you have a ~6 pixel wide blur applied to your image before you even press the shutter!

But the good news is that the depth of field on a camera with a crop factor is deeper for the same field of view and aperture.


>But the good news is that the depth of field on a camera with a crop factor is deeper for the same field of view and aperture.

To be completely honest, that's the bad news and the reason why I miss my film SLR so much after I switched over to digital. I absolutely adored my 50mm normal lens's nice thin depth of field, and I miss having that on the smaller format sensor.

>f/22 is likely to show blurring from diffraction through the small aperture

I'm gonna have to learn about these concepts -- I'd heard that diffraction causes decreased sharpness when stopped down but I didn't know it was a significant issue in modern lenses. I do know that I get significant chromatic aberration on my 28mm, but I always figured it was due to its retrofocal design. Do you have any reading recommendations?


> Do you have any reading recommendations?

Not really. I remember using a table which gave you the optimum aperture for maximum sharpness, based on the distance that the lens moved when focusing between the front and back of the subject. That kind of thing is only really useful for MF and larger, and I only used it for things like landscapes where sharper was always better. The problem with small formats is that it's hard to know how far the lens is moving, so you can't really use this technique.

In the most general terms, opening your lens all the way gives you aberrations, closing it all the way gives you diffraction, so you'll typically shoot in the middle unless you have a reason to do otherwise. For a rule of thumb, take the apertures you use for 35mm and adjust them by the crop factor. So if you liked to shoot everything at f/8 with 35mm (a common choice), then lean towards f/5.6 with your 1.5x crop digital. Conversely, if you start lugging around a 6x7cm camera, you'll use f/16 as your default.

Yes, for really small cameras, this means really big apertures. The iPhone 4S always shoots at f/2.4, for example.


I am getting similar specks from the dust on the sensor, not so much on the lens on a D7000.


No sunlight in the images? For starters, here is a n image of the sun: http://kurtmunger.com/sitebuildercontent/sitebuilderpictures...


Yes, you're right, sorry. There is one example, maybe it's cherry-picked, maybe it's just one example that happens not to have this issue. What I'm saying is, it absolutely is a real issue, which is contrary to the thesis of this article. What's more, it is easy to mitigate the issue. I've spent more time writing these replies than wiping dust off my lenses ;-)


He specifically said that he took multiple images of the sun and couldn't find any issues.


Adding to what's been said, I believe the worst situation (in terms of seeing dust on a lens) would be:

1) wide aperture

2) depth of field that (even partially) includes objects on the lens itself

In normal situations, these two conditions are somewhat mutually exclusive. That is, a wide aperture decreases depth of field, making it less likely for anything as close as the lens to be in (partial) focus.

The reason you may see the effects of a dirty lens more with fisheye or wide-angle lenses is that they often have a very short hyperfocal distance (bringing most everything into focus), so it's much more likely that condition #1 won't negate the effects of #2. These conditions would also be likely to occur in low-light macro photography.


When I see experimental evidence, and somebody arguing against it, I trust the former, especially if the latter feels the need to say 'trust me, I am a professional!'.


I love this! As a hobbyist in a couple of different gear-heavy fields (photography and guitar/recording), I've seen from experience how much gearheads obsess over exactly the wrong things. They'll worry about second or even third-order issues, while ignoring basic, obvious issues.

The internet is full of detailed discussions of camera lenses - barrel and pincushion distortion, lateral fringing, all sorts of issues you can only see when you're photographing test charts on a wall, with plenty of learned comments from other guys who shoot test charts on walls. This stuff panics people who try to buy cameras, thinking their ability to take good photos will be governed by these abstract numbers.

Feh.


Maybe I don't see a lot of good photos because I'm not looking hard enough. But the problem with "GAS" is that it puts all the focus on the gear and takes attention away from technique/lighting/composition etc. You can make great photos with a pinhole box camera if you wanted to (and I'd probably want to see them more than some rich shmoe with a brand new DSLR with 400 mgpx's photos).

Spend your money on books, classes and prints. Not on cameras/lenses.


I always recommend two books to anyone asking about buying a camera - "Understanding Exposure" (Bryan Peterson), and "The Photographer's Eye" (Michael Freeman). These two books cover all the basics of exposure and composition in a pretty accessible way.

Those two books will get you farther toward taking good photos than any piece of gear will.


Evolution of a photography gearhead:

1) Buy the best possible camera - no good pictures ever

2) Buy the best possible lenses - barely any good pictures

3) Buy the best possible lights - now we are getting somewhere

4) Learn how to compose and capture the moment - Bingo!

Most people assume 1) and 2) are the most important, barely anyone does 3) and some do 4). Any digital camera since 2010 or so can produce breathtaking pictures with 4) and cheap zoom kit lenses, for studio work it's all about 3). Then to get to the ultimate pro level it's about Photoshop skills to finalize the look as desired.


Not a whole lot new in this article, though its "experimental" results confirm well-known phenomena regarding camera lens performance. In particular, small front-element blemishes do not in general significantly degrade optical performance.

That said, dirt or scratches become more important when there is greater depth of field, for example, shooting with ultra-wide angle lenses stopped down to small aperture. Naturally, how much image quality degradation is acceptable depends on the circumstances, there's no single rule that can be applied.

I wouldn't try to get into the laws of physics/optics governing these considerations, there are plenty of sites on the web for that. However I recommend taking a look at the LensRentals site for its wonderfully practical, entertaining lens information (including info re: user-level lens testing): http://www.lensrentals.com


True for very large lenses where the dust and front element is sufficiently far and disproportionate to the aperture size!

But for smaller cameras, especially cell phone cameras, that dust and smudge is magnified immensely and has a much much greater effect. The epitome of this effect is having dust directly on top of the sensor, which obviously is visible directly. Imagine how small your cell phone camera is: that dust is only a very short distance from the sensor, and it's not much better than being right on top of it. Dust on a small lens is also proportionately larger compared to the lens and the aperture. All in all, much greater effect. This article might as well not even apply to small cameras.

Moral of the story: you should always clean your small camera lenses, and especially cell phone lenses! For larger lenses, the dust and smudge has less of an effect.


There's this attachment called an "Anti-Reflection Device"[0] that goes in front of rifle scopes. It's basically a honeycomb sunshade that, like the name says, minimizes reflections from the lens to make the shooter harder to spot. The cool and unintuitive thing about this gadget is that the honeycomb pattern doesn't actually appear when viewed through the scope. It's the exact same principle at play here.

[0] http://www.amazon.com/Tennebrex-Killflash-Scope-Anti-Reflect...


While obviously the results show that scratches and smudges can be practically unnoticeable, this article is a little misleading.

For one, dust, smudges and scratches will affect the contrast of an image, and more noticeably with a deeper depth of field. I'm sure you've noticed this on cell phone shots with oil or makeup on the lens, as it's much more noticeable with deeper depths of field. This is simply because incident light will diffuse into all areas of the sensor/film, causing dark areas to get lighter than they should be.

Additionally, the results here are incomplete. The author keeps his lens aperture wide open, which will keep depth of field pretty shallow. The deeper the depth of field (from smaller apertures, wider lenses, or smaller sensors) the more noticeable the scratches and dust will be, since it will localize the effects of the diffusion on the sensor/film.

Deeper depths of field are often preferred by landscape photographers, to keep fore-, mid-, and background elements all in focus, which will make smudges/scratches more obvious. Additionally, many lenses are much sharper when stopped down (smaller apertures) from wide open. Same problem.

I think it's a bit of a shame to see a perfectly good lens ("optically and mechanically fine"), which could have been donated or still sold at full cost (no photographer worth their salt cares about body scratches), be completely destroyed because the author wanted to prove a flawed point.


It proves again the basic rules for handling photo gear in hostile environment. Pick a lens that covers the needed focal distances and never change or clean it on the field, as you will risk damaging camera or decreasing the aftermarket value of your gear. If the dust on front element becomes visible on pictures, just open up the apperture.


rule of thumb - the longer the focal length the less are the effects of scratches on the front lens. ultrawide likes of 35mm and smaller are very sensitive to material on the front glass element. this translates into some really nice savings if you want to get a lens in 90mm+ range for example if there is a scratch on the front lens.


Given all the comments, I'm surprised to see no one mention flat field images and flat field correction. This would be the proper way to measure and even correct for blemishes and dust like this.

Basically a flat field image is an image of a completely uniform illumination pattern (i.e. given a perfect sensor and lens with no vignetting all pixels would have the same value). This lets you measure all sorts of things, but comparing flat field images of before and after dust/tape were applied would actually highlight the exact effect.

Using flat field correction, you can even correct for these issues to a great extent by scaling the pixels as appropriate to basically account for their being light paths between the object in the scene and the image projected onto the sensor.


If only this was true for sensor dust as well.


Sensor dust is the worst. I switched from shooting on Canon DSLRs several years ago and now shoot on Sony mirrorless - the NEX-7 and a7R. Because I exclusively use primes I tend to swap lenses quite a bit and as a result my sensor gets dusty fairly quickly without a mirror to shelter it. Even with a blower bulb it tends to show up. This isn't much of an issue because I also like shooting wide open including down to f/0.95 and sensor dust is never an issue when shooting fast, but then I'll decide I need to go to f/11 or slower for a landscape shot and boom, I've got smudges in the photo thanks to the dust on the sensor.


Yep, I'm on a Fuji x-pro1 mirrorless. Ended up getting a boulder of dust on my sensor when switching lenses at the top of Castillo San Cristóbal in San Juan.


If only this was true for dust on the rear element of the lens as well.


When the camera is stopped down (like for a bright desert scene) isn't just the middle of the lens being used?


No. Don't forget, the in-camera image is inverted. When a camera is stopped down, the edges of the image are mapped by the opposite edge of the lens, more like a pinhole camera.


Placing stuff on your lens usually affects bokeh - try f1.4 in the night with distant lights in the background with something stuck on your lens - you'd see the effect everywhere ;-)


So weird. I've been reading Kurt Munger's reviews for years and now to see one of his articles on HN. Strange crossing of paths.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: