Life’s an ocean with too much commotion

Hot pixels

by koenvereeken on Jul.04, 2007, under Software, Tech

Some months ago I’ve bought a Nikon d70 (second hand).

Since two weeks my camera is having some green pixels on every picture I take, especially on pictures where it’s dark or with a great exposure value.

I’ve created a script that will parse a picture and interpolate saturation, hue and luminosity values from the second left and second right pixel. So if you have a hot pixel at x,y, it will use the interpolated HSL value of pixels at positions x-2,y and x+2, y. When the given coordinates of the hot pixels are out of range, it will assume the picture is in landscape position and flip the x and y coordinates. With an extra option, it will interpolate all pixels from position x,y to x,bottom of picture. This was necessary because at every picture I took, there was a weak green line visible to the bottom of the picture.

To parse the image files, I use the rMagick library.

Click here to download the hotpixelcleaner gem.

Note: This script has been created to fulfill my needs, but comments are welcome of course.

Here’s a short howto:

$ sudo apt-get install librmagick-ruby1.8
Unpacking librmagick-ruby1.8 (from .../librmagick-ruby1.8_1.13.0-1_i386.deb) ...
Setting up librmagick-ruby1.8 (1.13.0-1) ...

$ sudo gem install hotpixelcleaner-0.0.1.gem
Successfully installed hotpixelcleaner, version 0.0.1

$ hotpixelcleaner --help
Usage: /usr/bin/hotpixelcleaner -f <imagefile>

Options are ...

--co (-c)
Coordinates of pixel to transform 'x,y'
--help (-H)
Print help information
--image (-f)
Use this image file
--out (-o)
Filename to write results to
--to-bottom (-b)
Process image from the given coordinate to the bottom of the picture
--usage (-h)
Print usage information

$ hotpixelcleaner -c 5,5 -f foo.jpg -o bar.jpg -b
Image has been saved to bar.jpg


Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...