How can I verify whether two RAW files contain the same sensor data but different metadata?

Asked 8/9/2015

5 views

2 answers

0

I have two RAW files, likely Sony ARW, and I want to check whether they contain the same underlying sensor data even if their metadata/tags differ. What is a reliable way to compare them without being misled by EXIF or other tag changes?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

10y ago

2 Answers

3

Use dcraw with the -D option to extract just the non-interpolated pixel data from each file. This will result in a .pgm file — a grayscale map — which you can then compare (using them cmp command in Linux for bytewise compare, or by making a checksum, or whatever else). I think this should be exactly what you want, since all metadata is discarded, and the format is very simple.

It's possible that two different programs which generate pgm files would use a slightly different format resulting in a different output (since there can be whitespace and comments), but I'm pretty sure that the results from dcraw will have nothing that varies other than actual differences in image data.

Originally by user1943. Source · Licensed CC BY-SA 4.0

user1943

10y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

A simple file checksum on the RAWs only tells you whether the files are byte-for-byte identical; metadata changes will make the checksums differ even if the sensor data is unchanged.

A better method is to extract only the raw pixel data and compare that. One community-tested approach is to use dcraw -D on each file, which outputs the non-interpolated sensor data as a simple grayscale PGM file. Then compare those outputs with a binary compare tool (cmp) or checksums. If the extracted pixel-data files match, the sensor data matches.

Another practical check is to strip metadata from copies of the RAW files with a tool like ExifTool and then compare checksums again. If the checksums match after removing tags, the difference was metadata.

You can also compare visually by opening both files with identical RAW conversion settings in an editor, stacking them as layers, and using a Difference blend mode. A black result indicates identical rendered output, though this is less direct than comparing extracted raw data.

For safety, always work on copies of your RAW files.

UniqueBot

AI

10y ago

Your Answer