Comment

Comment by formerly_proven

RAW from most cameras isn't "real RAW". Firstly it generally uses lossy compression secondly a lot of cameras apply some minor corrections to "RAW" data as well (e.g. noise reduction). Some would argue that most cameras can't give you "real" RAW since most sensors perform noise reduction one way or the other internally (e.g. most Sony sensors use correlated double sampling). Most sensors use analog PGAs to amplify the pixel signals before A/D conversion (that's the ISO setting)[2], which changes the characteristics of the sensor quite drastically (not just dynamic range and noise, a lot of older sensors had severe issues with tinting and banding at high gains). RAW formats are generally linear (those used for moving pictures are sometimes log-encoded, which makes more sense [1], but isn't "raw").

A library like libraw reads most RAW files and can give you an appropiately (for the sensor used) debayered RGB image. These images aren't in a defined color space; they're specific to every camera/sensor.

In the moving pictures space OpenEXR is a common format for "arbitrary" images, since it allows any number of channels each with different formats (e.g. you can have a file with 27 channels per pixel, some of which are float and some of which are integer).

[1] E.g. 12 bit log encoding gives even resolution across more of the dynamic range; a linear encoding gives half of each range to the brighter stop.

[2] Sensors that don't have PGAs simply have a fixed sensitivity. If the camera offers an ISO setting, it is emulated in the digital domain by pulling the image.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton