With a DSLR, it’s simply a matter of cleaning…but when stuff works it’s way into a P&S, it involves dismantling the camera. So here’s one way to deal with it, for those of you unfamiliar with “flats”.
A proper flat involves a lightbox and a proper exposure, but this is a quick and dirty technique. It’s not perfect, but it is functional.
Here’s the original exposure that made me try this:
It’s a bit dark, but you can see a bunch of crap that’s worked it’s way into my camera over the years on the right of the frame. Once I saw this, I pointed the camera at the ground from about 2 feet away and half-pressed the shutter button to lock focus up close, then swung the camera up towards a relatively evenly-lit part of the sky and snapped an out-of-focus shot. You can easily see the trash casting shadows on my sensor in the image:
To make use of this image, I loaded up the original into gimp and then loaded my improvised flat as a layer on top of the original. I then desaturated it to grayscale and inverted it. You can really see the yuckus in there now:
Now, change the layer mode for the inverted flat to “overlay” and you get this:
This affects the color balance and levels somewhat, but that’s easily corrected. This last image has had it’s levels adjusted to approximate the exposure of the original for comparison. There is only a slight hint of the offending litter left: