Thanks for your help on this.
@waterwingz, I'm using CHDK 0.9.9-1470 now on my S95 1.00e.
I just tried Phil's suggestion of adding 72 to the X value and 24 to the Y value and it didn't work for me, but I probably need to try more carefully when I have a bit more time. Sounds like it should work so I guess I'm doing something wrong at the moment. Phil, it sounds like you've done this with the G12. How did you generate the badpixel.txt file? After generating mine, I plotted all the coordinates in the badpixel file as a scatter plot and overlaid them on an image. Even before adding the 72,24 offset, some coordinates lie outside the x range of the image (a png I generated from a .cr2 with rawtherapee) so I assume this means my badpixel.txt file is wrong. Is the format of the badpixel.bin file described somewhere? - if so, I can write my own program to generate the badpixel.txt file directly from it.
There still seems to be some confusion over the various bad pixel files, so I'll try and clarify it.
badpixel.bin & the CHDK menu option to 'Create badpixel.bin'This is only used by the CHDK code when saving a DNG format raw file. The file is a binary file containing a simple list of 16 bit integer values, each pair of values is the X,Y co-ordinate of a bad pixel in the raw image.
The 'Create badpixel.bin' option takes two photos and then scans the raw data looking for pixels with a value of 0 - these will be dead pixels in the sensor. It then writes these out to the file.
You don't need to do anything with this file, CHDK will automatically use it when creating a DNG file. The 'Bad pixel removal' option in CHDK does not affect this process.
If you aren't saving raw as DNG then this bad pixel file is not used - the assumption being that the RAW convertor will do the bad pixel correction.
Note this does not deal with stuck/hot pixels only dead ones.
You don't need to convert this file to generate badpixel or badpixel.txt.
badpixel & badpixel.txtThese are text files that you can manually create to fix stuck/hot pixels. Each line in the file should contain the X,Y address of a bad pixel. You probably only need one of these; but they are limited to 8K in size so if you have a lot of stuck pixels you could use both (or get a new camera).
You have to set the 'Bad pixel removal' option for CHDK code to fix these pixels.
Normally this code should be called before the camera generates the JPEG so it should fix the pixels in the JPEG image.
The co-ordinate values should be relative to the top left corner of the raw image. If you use a camera generated JPEG image to get the pixel co-ordinate you need to add an offset since the JPEG is cropped from the raw data. If you can convert a .CR2 raw file and your raw convertor shows the full sensor image data (including the dark edges) then you can get the correct co-ordinates directly.
All of the bad pixel files must be in the CHDK directory on the SD card.
Phil.