I am trying to use Mathematica to import and process raw camera data in the Canon CR2 format. What I would like is data which has a linear relationship to exposure. I am thinking that the closest I could get to that would be demosaiced data imported with gamma = 1. Can anyone tell me what preprocessing occurs for Import[imageFile] when the imageFile is a raw format?

Thank you.

  • $\begingroup$ What is the extension of your file? Have you checked the corresponding Docs page for your file extension? $\endgroup$ – Alexey Popkov Oct 10 '17 at 3:59
  • $\begingroup$ The extension is .cr2. It is generally documented as a raw format, but I find no information on what processing does or doesn't happen as part of importing a raw format. $\endgroup$ – David Keith Oct 10 '17 at 4:10
  • $\begingroup$ Looks like the "RawImage" element is what you need. But I'd be interested to know what processing is done by default. $\endgroup$ – Alexey Popkov Oct 10 '17 at 4:30
  • $\begingroup$ Also "ColorProfileData" element can shed light on the encoding. Then you can use ColorConvert to convert to sRGB which on turn can be converted to linear RGB. $\endgroup$ – Alexey Popkov Oct 10 '17 at 4:34
  • $\begingroup$ Related: mathematica.stackexchange.com/q/42153/280, mathematica.stackexchange.com/q/144019/280 $\endgroup$ – Alexey Popkov Oct 10 '17 at 4:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.