BatchHotpixelRemover
BatchHotPixelRemover is a console application (for Windows) intended for removing hotpixels from your JPG files quickly and precisely, causing only local quality loss. It's a unique tool for the purpose.
How does it work?
First, the program extracts the locations of the hotpixels from "dark shots" taken with the camera.
Then it iterates the JPG files to be fixed, determines the 8x8 JPEG blocks affected, applies a spot healing around the hotpixels,
then replaces those blocks - and only those - with the new values of the fixed blocks.
That way, the pixels of the original and the fixed JPG will be identical except the 8x8 blocks contain hotpixels.
Learn how to use BatchHotPixelRemover below.
1. Unpack the zip into an empty folder
2. Create some "dark shots" with your camera: shoot pictures without removing the lens cap.
These pictures contain the hotpixel info in a clear way. Copy these files into the /_black directory.
3. Customize the config.xml
The file contains two parts. The <detect> tag holds the configuration of the extracting the hotpixel info from the dark shots. The <heal> tag configures the hotpixel removing process.
Check the config.xml below, with the comments.
<config> <detect> <indir>d:/exec/_nlacapps/bhprem/_black/</indir><!-- dark shots dir --> <filter>*.jpg</filter><!-- dark shots filename filter --> <outfile>d:/exec/_nlacapps/bhprem/_black/hotpixels.xml</outfile><!-- output file to be generated --> <outimage dxtext="-50" dytext="-10">d:/exec/_nlacapps/bhprem/_black/hotpixels.png</outimage><!-- a special file to be generated, to visualize the hot pixels found --> <channels>58</channels><!-- 8..64, default:32 (less means less hotpixel will be found, more means more) --> <amount>0,999</amount><!-- 0,999..1,0 default:0.999 (you don't need to change it..)--> <hprad>3</hprad><!-- 3..4 default:3 (you don't need to change it..)--> </detect> <heal> <indir>d:/exec/_nlacapps/bhprem/_in/</indir><!-- pictures to be healed --> <filter>*.jpg</filter><!-- filter for the picture file names --> <outdir>d:/exec/_nlacapps/bhprem/_out/</outdir><!-- output dir --> <method>1</method><!-- 0|1, default:1 (opencv retouch method)--> <range>3,0</range><!-- 1..100, default:3 (param of the retouch method, no need to change from default) --> <saveformat>jpg</saveformat><!--jpg|png|tif, default:jpg--> <diffimages mul="60,0">0</diffimages><!--0|1, default:0 Create "diff" images or not. The "mul" attrib. is the multiplicator of the difference values--> </heal> </config>
4. Run do_detect.bat - needed to perform only once
That will generate the hotpixel xml.
<hotpixels> <width>2560</width> <height>1920</height> <pix x="1712" y="59" r="3"/> <pix x="2297" y="73" r="3"/> <pix x="2375" y="230" r="3"/> <pix x="153" y="277" r="3"/> <pix x="1613" y="277" r="3"/> <pix x="1794" y="361" r="3"/> <pix x="779" y="567" r="3"/> <pix x="2358" y="604" r="3"/> <pix x="1621" y="622" r="3"/> <pix x="2154" y="657" r="3"/> <pix x="808" y="1129" r="3"/> <pix x="1067" y="1213" r="3"/> <pix x="677" y="1424" r="3"/> <pix x="1274" y="1480" r="3"/> <pix x="685" y="1592" r="3"/> <pix x="2538" y="1817" r="3"/> <pix x="1178" y="1824" r="3"/> </hotpixels>
5. Copy the files you want to remove the hotpixels from, to the /_in directory.
6. Run do_heal.bat
The healed images will be copied to the output directory, into /_out.
That's all.
Tips
- You can create separate config and hotpixel xmls for different cameras
- It's recommended to re-capture dark shots and re-generate the hotpixel file by some months, the number of the hotpixels generally increases in time.