Forgot Password
Pentax Camera Forums Home
 

Reply
Show Printable Version Search this Thread
12-09-2010, 05:17 PM   #1
Senior Member
ghl's Avatar

Join Date: Feb 2008
Location: California
Posts: 114
Mapping hot pixels in a P&S

In post-processing some B&W images the other day I noticed some unnatural looking areas. Mainly, what looked like specular highlights in dark shadow. After seeing the same pattern on two different photos I suspected what I was seeing were hot, or stuck pixels in the sensor.

After some work I was convinced that this was indeed the case and took the time to quantify this observation. I eventually ended up with a transparent overlay of hot pixels that I can use in helping to edit a photo if the hot pixels happen to be in an area of importance, given the photo.

At any rate, it's nice to know where the hot, or stuck pixels are in a P&S. So if anyone's interested in how to do this, here ya go!

First, you need to know when your camera accounts for hot pixels. For example, my S5i will only take a black frame "sensor reference" in night-mode which it uses internally to interpolate color values for stuck pixels before writing the final output to the card. Most cameras do this to some extent, either based on the mode the camera is in or the shutter speed used.

In my instance (an S5i) I knew the black frame reference only happened in night-mode and was not shutter speed driven (info from the manual). So, I held my hand over the lens which forced the camera to take a 1/4 sec. exposure (the longest shutter speed of the S5i in all modes except night-mode which allows a 4 sec. shutter speed).

Then I processed this photo in GIMP to provide a transparent overlay that I could use to see if any of the stuck pixels were in areas of importance for any picture taken with the camera.

The following steps are applicable to any photo editing software that supports selection by color, layering, transparency, etc., though I used GIMP.

1) Take a picture with your hand, lens cap, etc., covering the lens with the longest shutter speed you can without the camera providing a black frame reference.

2) Convert the .jpg from above to a .tiff. (Assuming .jpg is the output from your camera, if your camera supports raw then this post doesn't apply).

3) Open the .tiff in your post-processing software and use the "threshold" tool to bring out the stuck pixels. One has to find a good setting for this, and this takes experimentation. The first attachment below shows what I ended up with. I suspect that only three of the seven white spots are stuck pixels, the others are most likely dust on the sensor. One can take the threshold level too low and end up with garbage, so this does take some experimentation. (First attachment: 01-Threshold)

4) Use a brush tool to paint a circle of color over any white points. I used red with a much larger radius than the stuck pixels so that it is easily seen when overlayed. (Second attachment: 02-Paint)

5) Use a "select by color" tool to select your painted over stuck pixels.


6) Copy this selection to the clipboard.

7) Create a new transparent layer in the photo editing software.

8) Paste the clipboard onto the new layer and anchor it to the new layer.


9) Delete the background layer from the photo editing stack leaving nothing but the transparent layer with your stuck pixel map.

10) Save this as a .tiff because .jpg does not support transparency and will "flatten" the image with an opaque white background. (Third attachment: 03-Stuck pixel overlay)


Now you have a map of the stuck pixels (and possibly some dust) of your sensor.

To use this map in post-processing just bring in your photo as the first image and then bring in the map as an overlay. If the red dots of the stuck pixel map don't lie in important areas of your photo then I wouldn't worry about anything. However, if they do then one can easily use the cloning tool to somewhat correct the situation.

I've used this hot pixel map in the last couple of days to look at some photos where I thought things were weird, and indeed the areas that were bothering me correlated to the hot pixel map. Specifically, the B&W photos I was working on and a few macro pictures.

The last two attachments show where the hot pixel map can come in handy. The hot pixel (Fourth attachment: 04-Mapped Pixel) is in my wife's hair, but could just as easily been on her face. The other hot pixels are in areas of the picture that I don't consider important (and in fact this one is not either). The last attachemt (Fifth attachment: 05-Hot Pixel) shows the correlation between the mapped hot pixel and the actual hot pixel in this particualr photo.


Before anyone makes the claim that this would not be significant in a print of size that doesn't exceed the capabilities of the camera please know that I agree. I don't print above 5x7 inches with the S5i output. But also please note that what brought me down this path was what I thought were specular highlights in some B&W renditions from the same camera, where I had to ask "what the hell is this white spot doing in a black area?"

So it depends on the picture, where the pixels lie, contrast, exposure values, and what one tries to accomplish in post-processing. At any rate, this is a method to quickly see if any hot, or stuck pixels lie in important areas of your photos.

Granted, this sounds like a lot of work, but again remember that I did this not to be anal, but because I saw some patterns in some B&W photos from my S5i. Cheers to all!!


Last edited by ghl; 07-09-2013 at 11:31 PM.
12-12-2010, 07:56 PM   #2
Site Supporter




Join Date: Sep 2006
Location: midwest, United States
Photos: Gallery
Posts: 3,225
Super explanation of hot pixel mapping. You did a lot of work to fine tune it. Thanks for the info. Guess the Pentax doesn't have hot pixel mapping. A shame. Have an older Olympus C5050 that does.

A little surprised that the 5si only goes up to 5x7 quality wise. Seem to remember it being capable of more than that. Might not be as critical as you are.

thanks
barondla
12-13-2010, 03:21 PM   #3
ghl
Senior Member
ghl's Avatar

Join Date: Feb 2008
Location: California
Posts: 114
Original Poster
barondla,

The S5i can do acceptable prints at 8x10, but I don't like the way they look, it's sort of pushing it. This is assuming the ISO is set at 80 and the exposure is very good (only EV comp. on S5i) and that the nature of the picture doesn't lend itself to purple fringing. If all this is avoided it does well. But for most output 5x7 is it's practical limit.

Yeah, it doesn't map erroneous pixels so that's what prompted me to make my own map. On the good side it's a very small camera, and quite physically robust--I've been jamming it in my pocket for five years now and it still works great; and in Pan Focus mode it's fast. Still makes a great camera to just jam in your pocket as you walk out the door.

Actually, doing the mapping in GIMP really didn't take that much time. It was just finding a good setting for the threshold level that took experimentation. Thanks for reading and commenting.

ghl
12-13-2010, 10:02 PM   #4
Site Supporter




Join Date: Sep 2006
Location: midwest, United States
Photos: Gallery
Posts: 3,225
Enjoy your posts - they are pretty technical. I always learn something. Keep it up.

If I understand the process completely you are studying the map to see if strange looking pixels match the map. Wouldn't the next step be for the "map" to automatically fix the image? Like pixel mapping in a camera. Seems you are most of the way there.
thanks
barondla

12-15-2010, 05:06 PM   #5
ghl
Senior Member
ghl's Avatar

Join Date: Feb 2008
Location: California
Posts: 114
Original Poster
barondla,

I don't study the map per se, I just overlay it on an image I'm starting post-processing on to quickly see if the known stuck pixels are in areas of importance. If they are, I clone or heal the area(s), if they're not I move on.

You are correct in that a future step would be to have the map "automatically" fix the image. However, this would entail writing a script in GIMP, or whatever PP software one chooses, and either remotely invoking through code the clone or heal tool with pixel location parameters or writing my own bicubic or cubic local proximity algorithm to do the same.

And though I've considered this I don't feel it's worth the effort because I don't print that much, and when I do the other PP steps I perform take much more time than healing a few known bad pixels.

The script would be fun to write as GIMP now supports python plug-ins, but I don't feel it's worth the effort. After all, it's just S5i output!

ghl
Reply

Bookmarks
  • Submit Thread to Facebook Facebook
  • Submit Thread to Twitter Twitter
  • Submit Thread to Digg Digg
Tags - Make this thread easier to find by adding keywords to it!
attachment, camera, digital camera, layer, map, pentax cameras, photo, photos, pixel, pixels, point and shoot, s5i, shutter
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any hot pixels on your K-5? Raybo Pentax K-5 54 12-15-2010 01:51 PM
Hot Pixels? prinze18 Troubleshooting and Beginner Help 4 10-09-2009 11:22 AM
Hot pixel mapping on ist-D rburgoss Pentax DSLR Discussion 1 08-20-2008 07:04 AM
Hot pixels richard64 Pentax DSLR Discussion 4 08-05-2008 05:50 PM
Hot pixels, pixel mapping, and the Pentax Warranty? sklathill Pentax DSLR Discussion 24 12-19-2006 10:51 AM



All times are GMT -7. The time now is 05:55 AM. | See also: NikonForums.com, part of our network of photo forums!
  • Red (Default)
  • Green
  • Gray
  • Dark
  • Dark Yellow
  • Dark Blue
  • Old Red
  • Old Green
  • Old Gray
  • Dial-Up Style
Hello! It's great to see you back on the forum! Have you considered joining the community?
register
Creating a FREE ACCOUNT takes under a minute, removes ads, and lets you post! [Dismiss]
Top