As mentioned above, an alternative method is to tell raw readers that these weird pixels are bad. For dcraw, the bad-pixel list is a text file with each line containing three space-separated numbers: x-coord, y-coord, and timestamp. A timestamp of zero means “we don’t know when this pixel became bad” or “this pixel was always bad”.
Within each 16x16 square, before any image rotation, the four weird pixels are at:
6,10
6,14
14,2
14,6
A Windows BAT script that creates badpix.txt, the full list of all weird pixels, is:
setlocal enabledelayedexpansion
echo off
(
for /L %%Y in (0,16,3135) do (
for /L %%X in (0,16,4223) do (
set /A X1=%%X+6
set /A Y1=%%Y+10
echo !X1! !Y1! 0
set /A X1=%%X+6
set /A Y1=%%Y+14
echo !X1! !Y1! 0
set /A X1=%%X+14
set /A Y1=%%Y+2
echo !X1! !Y1! 0
set /A X1=%%X+14
set /A Y1=%%Y+6
echo !X1! !Y1! 0
)
)
) >badpix.txt
echo on
A bash script for the same thing is:
for Y in {0..3135..16}
do
for X in {0..4223..16}
do
((X1=$X+6))
((Y1=$Y+10))
echo $X1 $Y1 0
((X1=$X+6))
((Y1=$Y+14))
echo $X1 $Y1 0
((X1=$X+14))
((Y1=$Y+2))
echo $X1 $Y1 0
((X1=$X+14))
((Y1=$Y+6))
echo $X1 $Y1 0
done
done >badpix.txt
The first few lines of badpix.txt are:
6 10 0
6 14 0
14 2 0
14 6 0
22 10 0
22 14 0
30 2 0
30 6 0
:
:
Dcraw can then interpolate the missing values before it does any rotation, demosaicing and conversion to sRGB:
dcraw -P badpix.txt -T -6 -O i3.tiff IMG_20191105_134321.dng
For rawtherapee, which doesn’t use a timestamp, see Dark-Frame - RawPedia .