tags:

views:

324

answers:

2

Hello, I want to read the RGB values for each pixel from a raw image. Can someone tell me how to achieve this? Thanks for help!

the format of my raw image is .CR2 which is taken from camera.

+1  A: 

It's non-trivial, though libraw is a good start toward making it fairly easy.

Jerry Coffin
A: 

I believe you can find documentation on the CR2 file format here. Note that a converter (and C source) is provided on that page as well.

You should be able to re-purpose the parsing code to emit an array of pixels.

Kevin Montrose
Working with the unmodified data from the file will be difficult, as you need interpolation and gamma/tone curve conversion to get useful RGB values.
Mark Ransom
Kevin Montrose