« Found Typography | Main | My Camera Thinks it's a Graphic Designer »

November 12, 2005

Batch Action to Remove Hot Pixels

Although I haven't talked much about it yet on this site, I have been doing a lot of time-lapse photography lately. I use a Nikon Coolpix 995 which does a great job. The only thing is that it is getting old, and has a bunch of hot pixels. Hot pixels are those bright pink, green, or blue dots that show up in the same place on every photo. They aren't a problem for me under normal shooting conditions, but during long exposures they get really bad. Last week I was doing a time-lapse at night to record the stars moving in the sky. The exposure time was 8 seconds, so the hot pixels were very evident. Here is how I removed all the hot pixels from over 1000 pictures by creating a batch action in Photoshop.

1. The first thing we have to do is figure out where all the hot pixels are. You do this by taking a long exposure in the dark or with the lens cap on. Open this picture in Photoshop, and you will see a completely black image with hot pixels scattered all over. Use the magic wand with a tolerance of about 10 to select the black. Your selection should select everything but the hot pixels. You may want to experiment with the tolerance to make sure that you select the right amount of black vs. hot pixels. Next, go to Select and click on "Save Selection." In the window that opens, select "New" from the Document drop-down and "New" from the Channel drop-down. Name your selection "Hot Pixels" and click ok. This will open your selection in a new document. At this point you can close the other file so that you are left with only the new selection file open. Save the new selection file to your desktop, and name it something like "Hot_Pixels.psd." When you save it, make sure that "alpha channels" is checked. Now you can minimize that window (but don't close it) because we will use it again later.

2. Open one of the files that you are going to be removing the hot pixels from. We are going to create the action that we will use on all the files. If your Actions palette isn't open already, select "Actions" under the Windows menu to open it. In the Actions palette, click the triangle in the upper right corner and select "New Action." Name your new action "Remove Hot Pixels" and click "Record." Now unless we hit the stop button (the square at the bottom of the actions palette) everything we do in Photoshop will be recorded. Be careful not to do any undo's or extra steps. Next, under Select, click "Load Selection." In the window that opens, select "Hot Pixels" under document and "Hot Pixels" under channel. This will create a selection of everything except for the hot pixels. Under "Edit" select "Copy." Next, under "Edit" select "Paste." This will create a new layer. Now we go to "Filter" and select "Gausian Blur." Depending on the resolution of your image, you should set the blur to between 2-10 pixels and click "OK." Next, under "Select" click on "Load Selection" and load the "Hot Pixel" selection again. This time, make sure that the "invert" box is checked. This will make a selection of just where the hot pixels are located. Under "Edit" select "Copy," then under "Edit" select "Paste." Now delete the second layer (the one that is blurred). You should be left with two layers. One is the original image, and the second is a layer that covers up our hot pixels with the pixels that we blurred. Click the second layer on and off to see the before and after versions. If you aren't satisfied, you may have to go back and change the amount of pixels that you blurred earlier in this step. If everything looks good, flatten the image. Now save the image as a .jpg into a new folder on your desktop and close the file. Click the square on the bottom of the Actions pallette to stop recording our action.

3. Delete the image that we just saved into the new folder. We don't need it because this picture will get recreated when we finally batch all the images. If we don't delete it, it might mess up our batch when it tries to save over this file.

4. Back in Photoshop, make sure that our "Hot_Pixles.psd" file is still open. Now we are ready to start our batch of images. All the files you want to remove hot pixels from should all be located in the same folder. Under "File" select "Automate" and then "Batch." In the window that opens, make sure that "Remove Hot Pixels" is selected as the action. For the "Source," find the folder that contains all the photos that you want to remove hot pixels from. Under "Destination, select the folder where we saved our photo from step 2. It should look pretty much like this:

BatchAction.jpg

When you click "OK," the action will begin. It will take a few seconds for it to start processing, but then it should open every file in the folder, apply our action to it, and resave it to the new folder. Depending on the speed of your computer, this could take quite a while. I am usually doing several thousand images, so I like to let it run over night. Since my photos are all going to be combined into a time lapse movie, I usually add a resize command and sometimes some color correction to my action so that I can simply open the series of images in Quicktime as a finished movie.

I hope some of you find this tutorial helpful. Good luck, and let me know if you find anything missing in this tutorial.

Posted by Adrian at November 12, 2005 07:47 PM

Trackback Pings

TrackBack URL for this entry:
http://www.foundphotography.com/MT/mt-tb.cgi/45

Comments

This is a very useful action indeed!

Posted by: Luis dos Santos at November 13, 2005 04:00 AM

The comments on this page are no longer active. To access the live version of this page, please visit Found Photography's homepage and search the archives. Sorry for the inconvenience.