Copying canon dust delete data

Started by Tom Francart, April 10, 2010, 07:24:15 AM

Previous topic - Next topic

Tom Francart

Hi all,

Newer canon DSLRs have a function to add so called Dust Delete Data or Dust Removal data to an image, which is collected by the camera based on a test image and indicates where there's dust on the sensor. The dust delete data is saved in the EXIF data of each subsequent image. Spots can then automatically be removed from images using canon's DPP software.
However, it often happens that you only update the Dust Delete Data after you've already taken some images that contain spots. Therefore it can be useful to copy the dust delete data to older images.
The current version of ExifTool does not by default write the DustRemovalData tag. I therefore added a ~/.ExifTool_configfile containing the following:

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Canon::Main' => {
    0x97 => { #PH
        Name => 'DustRemovalData',
        Binary => 1,
        Writable => 1,
        }
    }
);


Then used ExifTool to save the desired DustRemovalData:
exiftool -s IMG_5921.JPG -DustRemovalData -b >dustremovaldata.bin

And add it to another image:
exiftool IMG_5917.JPG "-DustRemovalData<=dustremovaldata.bin"

DPP now flawlessly removes the dust from the latter image.

Note that you could also directly copy the tag from one image to another, but I find it useful to keep the dustremovaldata.bin file for later use.

Does anyone have more information on the format of the Dust Delete Data?

best regards,
Tom

Phil Harvey

#1
Hi Tom,

This is very interesting.  I haven't really taken a close look at the DustRemovalData to see how it works, so I don't know the format of this data.  I would look at dcraw to see if David Coffin has figured this out.

Since it seems a useful addition, I will make this tag writable (but "unsafe" because it affects the image) in the next exiftool release.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Flaviu

Hi, I have Canon 40D, and after taking 1000+ macro shots I noticed for the first time while viewing them on my PC, how dirty the sensor is... Each pic has hundreds of dust marks. I have the raw files, and I would like to remove those marks before I open the pics in Lightroom (I would like to use Canon's dust-"delete" algorithm in DPP instead of Lightroom's spot removal tool, for obvious reasons). I noticed the code posted to use with ExifTool is from 2010, and I have no idea how to use it... Were there any developments over the past year, to where this code is now part of this Exif utility? I appended the dust-delete data to the camera, and took a few pics with that. Now how do I apply it to the other pics that are already on the PC? Thanks in advance for any help...

Phil Harvey

This should work with the current version of ExifTool without the need for a custom configuration file:

Quote from: Tom Francart on April 10, 2010, 07:24:15 AM
Then used ExifTool to save the desired DustRemovalData:
exiftool -s IMG_5921.JPG -DustRemovalData -b >dustremovaldata.bin

And add it to another image:
exiftool IMG_5917.JPG "-DustRemovalData<=dustremovaldata.bin"

DPP now flawlessly removes the dust from the latter image.

To apply the DustRemovalData to a group of files, specify multiple file and/or directory names with the second command.  This should work for both JPG and CR2 images.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BogdanH

See, see.. very usefull to remember!

Bogdan

Flaviu

Thank you so much for the quick response Phil. Unfortunately I now discover that Lightroom ignores the dust delete data added by DPP to the raw files. I wonder if there is a way to have ExifTool take that data from whatever location it is stored in the raw file's metadata, and duplicate it to another location within the raw file or within the .xmp file, so that Lightroom would also read it? Maybe not. Probably LR will just need to be updated so it can read that dust-delete data straight from the raw files. ...   I suppose I could also save from DPP as jpeg or tiff and take those to LR instead of the raw files, but I'd rather work with the raw files in LR to better preserve them.  So anyway, thanks for the help. For now it just looks like I'll have to settle on working w/ tiffs in LR...

Phil Harvey

Yes, I am not surprised if LightRoom ignores the dust delete data.  This is proprietary information that I would only expect DPP to use.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

danish

hello phil, i was trying to implement this script but can not understand where to type this command line? either in c: or in image folder or how to work with this i've saved exiftool.exe in c: i ve large no of images on whome i want to apply dust delete data

Phil Harvey

See this thread for basic instructions on how to get started using ExifTool in Windows.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).