SEARCH

How-To Geek

How to Identify Stuck Pixels and Remove Them from Your Digital Photos

If you’ve noticed hotspots in your digital photos, areas where a stuck pixel in the camera’s sensor has rendered very bright spots of color that don’t belong in the image, you’re not alone. It’s an incredibly common phenomenon, but that doesn’t mean you have to put up with it. Read on as we discuss what distinguishes stuck pixels from other sensor defects and problems, how to identify it, and how to fix it both in-camera and out.

What’s a Stuck Pixel and Where Does It Come From?

First, let’s define what a stuck pixel is and give you an example of one so you have an immediate frame of reference. The most important thing to clarify right off the bat is that we are not talking about issues with pixels located on your camera’s on-camera LCD display screen. Any problems you may have with the LCD screen are certainly irritating but they don’t affect your images in anyway (just the display of those images on the camera body). Issues you have with the LCD screen on a camera are much like the issues found with desktop monitors as the design is quite similar. There isn’t much that can be done for on-camera display issues short of returning it for repair.

Inside your digital camera is a CMOS sensor and that’s the source of the pixel errors we’re interested in. The sensor is a tiny array of photodiodes arranged in a grid just like your computer monitor is a large array of pixels. Just like your monitor uses millions of pixels combined with backlighting to create an image you can view, the CMOS sensor has millions of pixels that capture light combined with a processing algorithm to create an image you can view. When everything works well, you don’t give much thought to those microscopic photodiodes. When things start to malfunction, however, suddenly one (or many) of the little guys take center stage in your photos.

The most obvious malfunction is known as a “stuck pixel.” In the case of a stuck pixel some or all of the photodiodes that make up the RGB component that comprise a single pixel in your image become stuck at their maximum value. This stuck pixel can therefore be bright blue, green, or red if only some of the photodiodes are stuck or pure white if all the diodes for that particular pixel are stuck at their maximum value. Here’s an example of a stuck pixel in the wild.

The left side shows two stuck pixels (one bright blue and one bright white) as seen at 100 percent crop in a JPEG image captured off a Nikon D80 camera. The right side shows a 3000 percent crop (with the Photoshop pixel grid overlaid). If you’re curious why the blue spot appears to bleed out like ink on paper, it’s a side effect of the JPEG processing algorithm in the camera. The actual stuck pixel is a fixed location but as the camera processes the raw input from the CMOS sensor using a demosaicing process and Bayer filter the single point of failure in the sensor ends up taking on this spot-like appearance.

A stuck pixel is distinct from other common artifacts and imperfections found in a digital image. A “dead pixel” in a digital image is the result of a set of non-functioning photodiodes. They’re not returning too-high values (such as all blue) they’re turning no values at all (which results in a pitch black spot). Some of the techniques we’ll outline today will in fact take care of dead pixels but our primary focus is on stuck pixels as they are easy to remedy and they stand out significantly more (as the eye is drawn to unnaturally bright spots against dark backgrounds).

In addition to stuck pixels and dead pixels there is what is known as “hot pixels.” Unlike stuck and dead pixels, which are fixed in place on the CMOS sensor just like a bad pixel on a monitor, hot pixels are a temporary artifact that comes and goes. When a digital camera is used for extended exposures (such as photographing star trails or other photo projects that require exposures that measure in seconds) the CMOS sensor heats up. Pixels that show up as “hot” in a long exposure may never show up again (and other pixels may appear hot in the next long exposure you take).

RELATED ARTICLE
How to Cheaply and Safely Clean Your Camera’s DSLR Sensor
If you snap photos with your DSLR long enough, it’s bound to happen: dust will find its way onto your... [Read Article]

Many cameras have a noise reduction function specifically for this situation wherein you take another photo (with the lens cap on) immediately after the first photo and the second photo is used to identify which pixels are currently hot on the CMOS and remove/blend those pixels with the original image. Consult the documentation for your camera and/or the manufacturer’s website to see if your camera has such a feature. These noise reduction filters are handy for cleaning up long exposures but cannot help with dead or stuck pixels.

Finally there’s physical artifacts that have nothing to do with defects in the CMOS sensor but under the right conditions can look like stuck pixels: plain old dust. If your DSLR is sporting a bit of dust on the sensor glass, you’ll need to clean it. Check out our guide on cleaning DSLR sensors to both identify if dust is the source of your problem and how to banish it if it is.

So where does this leave you, sufferer of the stuck pixels? Let’s take a look at the range of solutions available.

Fixing Your Stuck Pixel Problem In the Camera

There are a variety of ways to approach the stuck pixel problem that range from free to expensive and simple to complex. Read over the various techniques and decide what your camera warranty, budget, and patience will allow for. Let’s first take a look at the available in-camera solutions. Ideally you’ll be able to fix your camera here and tune out; realistically it’s usually tricky or expensive to fix the problem in-camera. It’s also worth noting that in-camera solutions are highly brand/model dependent and you’ll need to do a little search-engine legwork to determine if your particular brand and model support the techniques in this section.

Remapping the Dead Pixel

Modern digital cameras have millions upon millions of pixels. If one goes bad it’s not the end of the world (but when a few of them turn bright blue or green, it sure is distracting). Because the sensor has tens of millions of pixels to work with, the official solution offered by camera manufacturers is to simply “map out” the bad pixels. This solution is software based and essentially tells the camera “OK, Ignore pixel #12,486,200 and interpolate data from the surrounding 8 pixels to fill in the blank.” The result is a seamless cover up of the defective pixel such that even a forensics expert couldn’t tell you where the fix had been applied.

If your camera is in-warranty you can send it in to a repair facility and they’ll run diagnostics on your camera and map out the dead pixels. If your camera is out of warranty the service typically runs around $100-200. That’s expensive but on the upside it usually includes a professional camera cleaning as part of the diagnostic services.

Some manufacturers, such as Olympus, include pixel mapping features in their cameras’ firmware. This feature is enabled by closing the shutter/capping the lens and activating the pixel mapping option in the settings menu. A black reference frame is taken and any detected stuck pixels are mapped out; no trip to a repair center necessary.

If your camera includes the pixel mapping feature, by all means use it. If you just bought a new camera (or it’s still well within warranty) and you have a high number of stuck or dead pixels, by all means send it back in for repair. We’re not too keen on shelling out hundreds of dollars for a service call that maps out stuck pixels, however, for a simple reason. Yes, it will map out your current dead pixels, but it’s inevitable that as your camera ages you’ll end up with more. Rather than shell out serious cash every time a few crop up again, it’s worthwhile to use other techniques to banish them.

Shake It Loose with Auto Cleaning

There are quite a few camera models on the market that have an automatic cleaning feature. Essentially a tiny motor vibrates the housing of the CMOS sensor to an ultrasonic frequency (just like those high-priced toothbrushes and jewelry cleaning machines) in a bid to shake off motes of dust that have clung to the sensor glass.

More than a few delighted photographers have reported that the automatic cleaning process decreased or eliminated their stuck pixel problem. Given that this is essentially the microscopic version of gently massaging the pixels on an LCD screen to unstick them, we can see how it just might work. It’s a long shot, but it’s also a free shot (and you should be using the feature to clean your camera anyway) so you may as well try it out if you camera sports such a feature.

Note: Some manufacturers, such as Canon, combine the cleaning function with a remapping function (and don’t make it very clear in the documentation that the two things are happening concurrently).

Fixing Your Stuck Pixel Problem with Software

For those of us who aren’t lucky enough to have an in-warranty camera or a built-in cleaning/remapping function, the next best thing is to use software to take care of the problem. Let’s take a look at the automatic, semi-automatic, and manual ways you can mend your photos.

Switch to RAW

As we mentioned earlier in the article, the reason stuck and dead pixels look so big on the final JPEG image is a result of the filters the camera runs on them during the in-camera processing. You know the easiest way to avoid the bloom around each defective pixel and to get rid of them altogether? Shoot your photos in RAW format. When it comes time to process the photos just use a RAW processing tool like Adobe Photoshop, Adobe Lightroom, or RawTherapee as these tools will interact with the RAW format provided by your camera (and the embedded pixel information) and actively map out the hot pixels. (If you don’t need all the bells and whistles of both the bigger paid and free RAW editing suites and just want to edit out the defective pixels and be done with it, a less auto-magic but very viable solution for Windows users is the free application Pixel Fixer.)

RELATED ARTICLE
How To Process Camera Raw Without Paying for Adobe Photoshop
You might think that you need expensive software to take advantage of Camera RAW—something like Photoshop or the more modestly priced Lightroom. Fortunately there is freeware that can help you achieve professional results without professional costs. [Read Article]

Let’s see how that looks in action by showing you a picture captured on the same Nikon D80 we mentioned earlier. This camera, and many like it, will capture both a RAW image and process it into a JPEG image which is perfect for our purposes as we’ll get a chance to look at the exact same photo and compare.

Let’s take a look a full size crop of the photo then at a zoomed in comparison shot highlighting the same space in the RAW and JPEG formats.

It’s difficult to see the pixels at normal resolution and viewing distance, so we took the liberty of circling them for you. The top one is the same bright blue pixel from the sample photo earlier in the article, again paired with the brighter whitish green one. Let’s zoom in closely now using Photoshop and compare how the example same image in RAW format doesn’t have the defective pixels. It’s important to note here that we did absolutely nothing other than open the image with an appropriate RAW viewing tool; the RAW engine itself took care of the stuck pixels.

Any dead or stuck pixels will be completely mapped out when using the RAW format paired with an appropriate RAW reader. So what’s the downside to this technique? If you’re used to shooting all JPEG and just dumping your files into a non-RAW photo management tool like Picasa, you’re going to have to switch to shooting RAW (or RAW+JPEG) and a totally different workflow (at least to get your photos out of the camera and into the management tool you prefer). You’re also going to take a hit in the memory card department; while a JPEG might take up 1-2MB per photo a RAW image file will take up 7-8MB, easily.

Manually and Batch Editing Your Photos

Shooting in RAW from here on out can fix the problem, but what if you don’t want to shoot in RAW (because of memory and size considerations) or you have lots of photos with stuck pixels taken before you noticed the problem? You can manually edit individual images by hand, if you’re using a good photo editor like Photoshop or Gimp you can record your actions and semi automate the process, and you can also (once you’ve established that your action sequence works well) batch the entire process. Photoshop’s “Spot Healing” tool is a match made in heaven for this task.

Before we show you how to do this trick, we have to emphasize that the set of actions you’re about to create will only work on photos from the same camera and at the same resolution as the original photo you used to create the action for. Because Photoshop and Gimp will remember the exact coordinates of the individual brush strokes you make if you apply the action set to any other size photo or from a different camera with a different set of defective pixels, it won’t work.

Create a Reference Photo

You can use an existing photo as your reference photo, but you’re guaranteed to miss pixels; it’s just too hard to find them against a sea of regular objects like clothing and scenery. A good reference photo makes your life so much easier. Grab your camera and switch it to manual mode (if your camera doesn’t have a manual mode, approximate these settings as closely as you can). Switch the camera to manual focus, adjust the ISO to a high value  (at least ISO 800 or above), and adjust the shutter speed to something above 1/1000th of a second. The aperture doesn’t matter as the next step is to block out all the light; put the cap on the camera and, just to be extra cautious, cover the viewfinder with your thumb to ensure no light at all leaks in. Snap a few shots (and if you want to be really analytical about it, adjust the ISO up and down so you can compare the results for fun).

Examine Your Reference Photo

With your ISO 800+ millisecond exposure in hand fire up a sufficiently powerful photo editor like Photoshop or Gimp. The key is that you need to be able to heal or blend these spots and you need to be able to record yourself doing the actions (if you wish to batch the process, as we will in a moment).

With your reference photo open, scour the image looking for anything that isn’t pure black. The faintest hint of a super-dark-gray pattern that doesn’t converge into a lighter/brighter point is fine (this is just the background noise that is an inevitable byproduct of the digital photography process). Anything that even remotely resembles a colorful or white speck, blob, or point of light you should never see in a camera that has a lens cap on, however, is a stuck pixel. In the screen capture above.

Create an Action Set

Now that we have a reference photo we can create an action set that records the actions necessary to remove the stuck pixels in our image. As we mentioned before, you can do this manually for each photo but as long as you have an image editor that supports any sort of action macros, it makes little sense not to take advantage of it. Our instructions are for Photoshop, modify them accordingly for your editing application.

In Photoshop open your reference photo if it isn’t already open. Zoom in on one of the stuck pixels and select the Spot Healing Brush by pressing the “J” key or selecting it in the toolbar palette. Adjust the brush size so that it just barely covers the stuck pixel. Try out the brush to see if it removes the color (and returns the area to pure black) in one or two clicks. The goal is to use as little of the healing brush as possible because your real images won’t have a perfectly dark background; they’ll have multi-colored and highly dimensional surfaces that will look odd if the healing brush is applied heavily by the automated process.

After you’ve tested the brush and you’re happy with the results, undo them (Edit -> Undo or CTRL+Z). We’ll start with a fresh image for our recording. Open the Actions window (Window -> Actions or ALT+F9). Click the “New Action” button on the Action window’s toolbar.

Name your action. It’s best to name it very specifically, such as “Stuck Pixel Fix – Nikon D80 – 3872×2592,” so you never accidentally unleash it on the wrong size images from the wrong camera. Before we proceed there is one very important tweak to make; click on the fly-out menu in the Actions window and ensure that “Allow Tool Recording” is checked. If you do not check this, the Action process won’t record the tools we use, which is critical to the success of this process.

Once clearly named and with the tool recording toggled on, click the record icon (the circle button) at the bottom of the Actions window.  At this point all the edits you perform on the image will with recorded. You can pause the process if you need to by pressing the stop button icon (and resume it by pressing the recording icon) located at the bottom of the Actions window.

Pour over your image again and use the healing brush to touch up every stuck pixel you find. When you’re done press the stop button icon to finish the process and save the action set. Don’t be surprised if you have dozens of brush strokes or more recorded in your action list. Using the Action function to map out all the defective pixels on our aging D80 required 46 individual brush strokes.

 Test the Action Set

Now that we have our Action set, it’s time to put it to the test. Remember the photo from the start of the tutorial with the green background? We took that photo without a companion RAW file, so there’s no way we can fix it without editing the JPEG. Let’s load it up and see what our new Action set can do. With the image loaded (remember it has to be the same size as your reference photo) and your action set selected, press the play icon on the Action toolbar to run the action set.

Our hot blue and hot white pixel are history and all at the click of a button.  Go ahead and scan around the photo looking for any evidence of defective pixels. You may find, as we did, that a few escaped your watchful eye during the initial action creation process. Don’t fret though! You can easily add in extra actions to an existing action set. Simply select the Spot Healing Brush again, make sure it’s the size you want, and then press the record button. Touch up any of the stuck pixels you find and then stop recording to save the extra brush strokes.

Now you can apply your fine-tuned Action set to any of the older photos you have from the same camera that suffer from the same defects.


Although pixel defects are a fact of life that doesn’t mean you have to live with them. Armed with the tricks and techniques outlined in this tutorial you’ll never need to suffer through a photo with a laser-beam-red dot or neon-blue smear marring your photos again.

Jason Fitzpatrick is warranty-voiding DIYer and all around geek. When he's not documenting mods and hacks he's doing his best to make sure a generation of college students graduate knowing they should put their pants on one leg at a time and go on to greatness, just like Bruce Dickinson. You can follow him on if you'd like.

  • Published 08/21/14