Does Nikon NRW RAW use a linearization table or lossy quantization like some NEF files?
Asked 6/1/2017
6 views
2 answers
0
I’m trying to determine whether RAW files from a Nikon Coolpix B700, saved as .NRW, contain direct sensor data or whether Nikon applies a linearization/quantization curve similar to what has been reported for some .NEF files. A MathWorks discussion says certain older consumer Nikon DSLRs compressed 12-bit data to roughly 9–10 bits in NEF using a curve or linearization table, while higher-end DSLRs could offer compressed or uncompressed NEF. When I convert my NRW files to DNG and inspect them, I don’t see a LinearizationTable. Does NRW use the same kind of processing, or is the absence of that tag meaningful?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
9y ago
2 Answers
3
Correction — the linked article (including the comments thread following it) suggests that the .NEF format undergoes a linear quantization only for some consumer-grade DSLR cameras.
Mathworks.com user "Craig" says (in comment #4):
I did some checking and Nikon’s consumer-grade DSLRs (D90 and below) do indeed compress the raw sensor data from 12 bits to 9-10 bits in NEF format using curves of the type above. The higher-end DLSRs have the choice of compressed or uncompressed NEF.
(note, this Mathworks.com article and comments are from March 2011, so references to specific camera models are relative to that timeframe).
In Decemer 2011, user "Stephen Nuske" corroborate's Craig's statement (in comment #17):
Because it appears that there was no LinearizationTable applied by my Nikon D300S to the NEF. After reading the cfa from the Tiff, as you listed above, the values go up past 768 which is unlike the NEF you tested with. The values in my NEF went all the way to the full 12bit range (4096).
The quantization is applied for cameras that use (or optionally allow) "12-bit compressed" RAW format. This "compressed" format is lossy; in fact, it is the quantization table that creates this compression. In the Mathworks.com article you linked to, the extracted RAW data values range from 0 – 768. Note that log₂(768) ≈ 9.6, meaning that it requires 10 bits to store the range of values. Thus the D90 camera in the article compressed the 12-bit data to an approximate 10-bit range via the quantization table. (Nikon describes their RAW lossy format as "virtually lossless").
To answer your question, "I want the actual RAW data, I need to know if there is quantization happening in .NRW as well?", I do not believe the B700 compresses .NRW data.
I downloaded a sample .NRW file and extracted its tags using exiftool. One of the tags, Compression, returned Uncompressed:
> exiftool "-*Compression*" 2017-01-18_B700_0053.nrw
Compression : Uncompressed
Compare the output of a sample D90 .NEF file, which as we know uses compression:
> exiftool "-*Compression*" nikon_d90_04.nef
Compression : Nikon NEF Compressed
NEF Compression : Lossy (type 2)
For completion's sake, I tested against a sample .NRW file from a CoolPix P7800, which shows the RAW file uses compression:
> exiftool "-*Compression*" nikon_coolpix_p7800_01.nrw
Compression : Nikon NEF Compressed
NEF Compression : Unknown (7)
Originally by user11924. Source · Licensed CC BY-SA 4.0
user11924
9y ago
0
Generated from our catalog & community — verify before relying on it.
Based on the community answers, the MathWorks discussion does not show that all Nikon RAW formats use such a table. It specifically points to some older consumer Nikon DSLRs using lossy compression in NEF, while higher-end models could save compressed or uncompressed NEF.
That does not establish that NRW from a Coolpix B700 behaves the same way. Also, not finding a DNG LinearizationTable does not prove there was no prior processing; it only means the converter did not expose one in that form.
In general, “RAW” files are rarely completely untouched sensor dumps. They often include some camera-specific packing, black-level calibration, and sometimes compression. So the safest conclusion is:
- some Nikon NEF files were reported to use lossy quantization/curves;
- the provided answers do not confirm that NRW does;
- absence of a LinearizationTable in converted DNG is not definitive evidence either way.
If you need true sensor-level characterization, you would need format-specific reverse-engineering or vendor documentation for NRW/B700 rather than assuming it matches NEF behavior.
Recommended products
UniqueBot
AI9y ago
Your Answer
Related Questions
Does Lightroom edit compressed RAW files slower than uncompressed RAW files?
How much does Nikon’s lossy-compressed 14-bit NEF affect real-world image quality vs JPEG?
What artifacts can Nikon's lossy NEF compression cause?
Can 10-bit RAW sensor data be compressed, and how can I tell if it already is?
What’s the difference between VueScan’s TIFF and DNG output for archival scans?