I am more familiar with Nikon NEF raw files than Canon CR2, but I assume they work in the same way.
A raw file contains the values from the camera sensor, which records linear levels. Some pixels represent red values, some are green, and the rest are blue. dcraw interpolates so that each pixel contains red, green and blue values, and also converts from linear to some other colorspace: default is sRGB, but can be AbobeRGB etc.
The raw file will contain a flag that says what colorspace the photographer wants for the output. But I believe dcraw ignores this flag.
If you want the output to be AbobeRGB you can either run dcraw with "-o 2", or leave dcraw to do its default action, and use IM to change colorspace with "-profile sRGB.icc -profile AdobeRGB.icc". (This assumes both ICC files are in your current directory.) The first "-profile" embeds sRGB; the second converts pixels to AdobeRGB and replaces the embedded sRGB profile with the AdobeRGB profile.
For example:
Code: Select all
F:\web\im>%IM%convert -verbose IMG_8042384AdobeRGB.CR2 -profile sRGB.icc -profile AdobeRGB1998.icc acr2.png
dcraw.exe -6 -w -O "C:/Users/Alan/AppData/Local/Temp/magick-5800-YWFgErLFM8z.ppm" "C:/Users/Alan/AppData/Local/Temp/magick-5800mVeEMVnuMMT9"
Instead, I can use standalone dcraw to directly create a tiff file, in AdobeRGB, with embedded profile:
Code: Select all
dcraw -o 2 -w -O xcr2.tiff -6 -T IMG_8042384AdobeRGB.CR2
The results are not exactly the same. Most of the difference is due to differences in profiles. If I tell convert to use the exact profiles that dcraw uses...
Code: Select all
convert -verbose IMG_8042384AdobeRGB.CR2 -profile dcrSRGB.icc -profile dcrAdobeRGB.icc acr2.png
... the results are visualy identical, and "compare" reports a difference of 0.00968372, ie 0.9%.