How is color represented in a RAW file, and how is it converted to sRGB or Adobe RGB?
Asked 1/29/2013
2 views
2 answers
0
When shooting RAW, the in-camera sRGB/Adobe RGB setting is generally only relevant for JPEGs and previews. So what color representation does the RAW file itself use? Is RAW effectively in a camera-specific native color space based on the sensor and color filter array, and how is that mapped to standard spaces like sRGB or Adobe RGB during conversion?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
13y ago
2 Answers
12
It's just the values from the sensor, which is a (mostly) linear counter. The different photosites on a Bayer sensor have different colored filters, and the value for each site represents the light which gets through that filter. The name "RAW" is meant to convey precisely that the values are simply that "uncooked" reading.
In a sense, then, the RAW file is in the camera's native colorspace, where the primaries match whatever happens to be the wavelengths of the filter. Converting to a reference color space like sRGB or Adobe RGB is a matter of transforming from the native space to that, and to do it correctly you need to know the particular properties of the filters in a given camera's sensor.
Raw converters use a color matrix (specific for each camera model) to get their results. You can see this in the dcraw source code — it's my understanding that author Dave Coffin gets most of this information from Adobe, who in turn has relationships directly with the camera manufacturers.
Originally by user1943. Source · Licensed CC BY-SA 4.0
user1943
13y ago
0
Generated from our catalog & community — verify before relying on it.
RAW files store the sensor’s direct measurements: essentially linear intensity values from individual photosites behind colored filters (such as the red, green, and blue filters in a Bayer array). That’s why they’re called “raw” — the data is largely unprocessed.
So a RAW file is not usually in sRGB or Adobe RGB. In a practical sense, it starts in the camera sensor’s own native, camera-specific color space, defined by the spectral response of that sensor and its color filters.
To convert RAW data into a standard output color space like sRGB or Adobe RGB, the RAW converter uses a camera-specific color matrix/profile. That transform maps the camera’s native sensor responses into a reference color space. Correct conversion depends on knowing the characteristics of that particular camera model’s sensor/filter system.
So:
- RAW = sensor-native, mostly linear data
- sRGB/Adobe RGB = output color spaces used when rendering/exporting
- The mapping is done by the RAW processor using camera-specific color profiles or matrices
Recommended products
UniqueBot
AI13y ago
Your Answer
Related Questions
Do digital cameras have RGB primaries, and how does a camera’s native color gamut relate to sRGB/Adobe RGB/ProPhoto?
What color space does Lightroom use in the Develop module, and why export in ProPhoto or Adobe RGB?
How do sRGB, Adobe RGB, and ProPhoto RGB relate, and why might file size differ?
Does the in-camera sRGB/Adobe RGB setting matter when shooting RAW?
In Photoshop, is Adobe ACE more accurate than Microsoft ICM for color profile conversions?