Bad Pixel file

Moderator: jsachs

Post Reply
den
Posts: 856
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Bad Pixel file

Post by den »

PWP6's electronic manual seems to be mute regarding how to create a "Bad Pixel file", yet there is a folder location and provisions for utilizing one on the S&N tab of the Raw Dialog...

...is this file an 8-bit BW jpeg or tiff with white pixels representing 'bad pixels' on a black background?
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Bad Pixel file

Post by jsachs »

I believe this is a dcraw feature - the following is from the dcraw documentation:

:./.badpixels, ../.badpixels, ../../.badpixels, ...
List of your camera's dead pixels, so that dcraw can interpolate around them. Each line specifies the column, row, and UNIX time of death for one pixel. For example:
962 91 1028350000 # died between August 1 and 4, 2002
1285 1067 0 # don't know when this pixel died
These coordinates are before any cropping or rotation, so use dcraw -j -t 0 to locate dead pixels.

Also here is another sample file:

Each line specifies the column, row, and UNIX time of death for one pixel. For example:

# .badpixels file for my Canon PowerShot G2, serial no. 4624504380
# dcraw will use this file if run in the same directory, or in any
# subdirectory.

# Always use "dcraw -d -j -t 0" when locating bad pixels!!

# Format is: pixel column, pixel row, UNIX time of death

# This pixel went bad between August 1 and 4, 2002
962 91 1028350000
# This pixel went bad between January 9 and 30, 2003
902 877 1043000000

# These are only visible in low light, so I haven't dated them:
621 943 0
1285 1067 0
1286 1067 0
2181 1532 0

# I swept these up 4/19/2005
763 36 1110000000
1827 466 1110000000

# low light
198 1288 1110000000
346 328 1110000000
429 273 1110000000
621 943 1110000000
624 874 1110000000
848 400 1110000000
1682 1686 1110000000
1892 1250 1110000000
2234 484 1110000000
2242 618 1110000000

555 698 1135100000 # December 20-21, 2005
640 157 1139000000 # February 2-5, 2006
Jonathan Sachs
Digital Light & Color
den
Posts: 856
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Bad Pixel file

Post by den »

Thank you Jonathan...

So this appears to be a *.txt file...

While I will experiment and confirm, may I initially assume:
(1) the column/row numbers start from the lower left corner of the image?
(2) the columns/rows are based upon the 'dcraw' overall image dimensions of width/height and not the PWP6 overall image dimensions which are smaller?
(3) it is unnecessary to create both a landscape and a portrait orientation file?

...den...
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Bad Pixel file

Post by jsachs »

I don't have any information other than what I posted. I would not be surprised if the y coord is zero for the top left and not the bottom left. Setting -j -t 0 disables any image rotation or flipping so you should not have to do separate portrait and landscape versions. Not sure about the image size, but would guess it is based on the useful image size and not the sensor size.
Jonathan Sachs
Digital Light & Color
den
Posts: 856
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Bad Pixel file

Post by den »

Thanks again... ...will experiment and advise. ...den...
den
Posts: 856
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

'dcraw' Bad Pixel files & PWP's Raw Dialog

Post by den »

Part 1: creating a Bad Pixel file...

(1) Using 'dcraw', create two raw conversions of a camera's raw file. One for basic conversion that is auto-bright sRGB gamma 2.2 colors using options: -v -w -H 2 -t 0 -o 1 -j -6 -T... ...and one to show the sensor grid in BW using options: -v -d -j -t 0 -6 -T. Rename the first tiff file before running 'dcraw' with the second set of options as it will be over-written if not done so.

(2) Open both tiffs in PWP and Window/Arrange/Tile Vertical them so as to change Zoom Factors and navigate the images side by side.

(3) Open the Readout Tool with Probe Size 1x1 and OPT - Origin at top left.
Locating_BadPixels.jpg
Locating_BadPixels.jpg (32.25 KiB) Viewed 4342 times
(4) Systematically, go through the images initially looking for bright pixels in both images and record the Readout Tool's pixel values. The left value is a column and the right value is a row starting from the image's top left corner. Next, go through the images looking for 'out of place color' and broken grid crossings. Record these pixel readouts.

(5) Using a text editor such as NotePad, create a "BadPixel.txt" file. My file looks like this where the first number is a column, second number is a row, and the third number is a 0 because I am too lazy to figure out the dates. The # followed by text are comments...

# bad pixel list 121123
# Canon EOS-350D Serial 1120608687
247 1600 0
254 1004 0
270 636 0
796 353 0
904 1888 0
1578 1516 0
1651 1530 0
1714 87 0
1905 1362 0
2087 1392 0
2759 1118 0
2930 1846 0
3096 880 0
3379 1300 0

Part 2: Using "BadPixel.txt" in PWP's Raw Dialog, S&N tab...

(1) Place a copy of "BadPixel.txt" in C:\Users\<user name>\AppData\Roaming\Digital Light and Color\Picture Window\Badpixels... [May have to change folder preferences to show hidden folders -- a Vista OS path shown].

(2) Using the Bad Pixel File browser, select the "BadPixel.txt" file. Change the Repair Method from None to Median or Average... the bad pixels disappear...
RawDialog-SNtab_BadPixelRepair_None.jpg
RawDialog-SNtab_BadPixelRepair_None.jpg (44.64 KiB) Viewed 4338 times
RawDialog-SNtab_BadPixelRepair_Median.jpg
RawDialog-SNtab_BadPixelRepair_Median.jpg (44.65 KiB) Viewed 4342 times
A freeware, multi-threaded 'dcraw9.16' for Windows is described with a list of supported cameras and download link here: http://www.heliconsoft.com/dcraw.html

Now I do not need to remember where to use the Speck Removal tool...

Ask if there are questions...

...den...

Addendum: the created "BadPixel.txt" can also be used with 'dcraw' using option: -P "BadPixel.txt" if the file is located in the same folder as "dcraw.exe".
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Bad Pixel file

Post by jsachs »

Thanks for working through the details.
Jonathan Sachs
Digital Light & Color
Post Reply