{"id":303,"date":"2006-12-08T14:33:02","date_gmt":"2006-12-08T05:33:02","guid":{"rendered":"https:\/\/regex.info\/blog\/2006-12-08\/303"},"modified":"2006-12-08T14:33:02","modified_gmt":"2006-12-08T05:33:02","slug":"nef-color-space-settings-and-embedded-jpgs","status":"publish","type":"post","link":"https:\/\/regex.info\/blog\/2006-12-08\/303","title":{"rendered":"NEF, Color Space Settings, and Embedded JPGs"},"content":{"rendered":"\n\n<p>This post is not likely of interest to regular readers of my blog\n(&#8220;Hi Mom&#8221;); I'm putting it here mostly for the search\nengines.<\/p>\n\n\n<hr align='left' width='20%'\/>\n\n<!--TECH-->\n<div class=\"robots-nocontent\" style=\"border: 2px solid #FF8080;\n            float: right;\n            padding: 0 1em 1em 1em;\n            margin: 10px 0 1em 1em;\n            display: inline;\">\n<p style='white-space: nowrap'><b>My Tech-Related Photography Posts<\/b><\/p>\n<ul style='margin:0; font-size:80%'>\n  <li><a href='\/blog\/lightroom-goodies\/ipad-howto2'>My Lightroom-to-iPad Workflow<\/a><\/li>\n  <li><a href='\/blog\/lightroom-goodies\/'>Lightroom Goodies<\/a> (lots of plugins)<\/li>\n  <li><a href='\/blog\/photo-tech\/color-spaces-page1\/'>Digital Image Color Spaces<\/a><\/li>\n  <li><a href='\/blog\/other-writings\/online-exif-image-data-viewer\/'>Online Exif (Image Data) Viewer<\/a><\/li>\n  <li><a href='\/blog\/photo-tech\/focus-chart\/'>Jeffrey's Autofocus Test Chart<\/a><\/li>\n  <li><a href='\/blog\/photo-tech\/calendar\/'>Photoshop Calendar-Template-Building Script<\/a><\/li>\n  <li><a href='\/blog\/lightroom-goodies\/ipad-howto'>How to Prepare Photos for an iPad<\/a><\/li>\n  <li><a href='\/blog\/photo-tech\/nef-compression\/'>A Qualitative Analysis of NEF Compression<\/a><\/li>\n  <li><a href='\/blog\/2007-08-24\/554'>Tripod Stability Tests<\/a><\/li>\n<\/ul>\n<p style='font-size:85%; margin:10px 0 0 0'><a href=\"\/blog\/photo-tech\/\">more<\/a>...<\/p>\n<\/div>\n<!--\/TECH-->\n\n<p>\n\nA Nikon D200 dSLR has two <a\nhref=\"\/blog\/photo-tech\/color-spaces-page1\/\">color-space<\/a>\nsettings: sRGB and Adobe RGB. People often ask which should be selected\nwhen shooting in raw mode, with the oft-provided answer that &#8220;it\ndoesn't matter&#8221; because raw data has its own camera-specific\nraw-sensor-data color space, and sRGB vs. AdobeRGB comes in to play only\nwhen converting the raw sensor data to <span class='nobr'>a different<\/span> image format (e.g.\nJPEG).\n\n<\/p><p>\n\nIndeed, the color-space setting doesn't matter for the main picture, which\nis what people are generally asking about, so &#8220;it doesn't\nmatter&#8221; is <span class='nobr'>a good<\/span> first approximation of the answer.\n\n<\/p><p>\n\nHowever, even when shooting raw, there are effects to the resulting NEF\nfile from the on-camera color-space setting, so <span class='nobr'>I thought<\/span> I'd document them\nhere for completeness:\n\n<\/p>\n\n<ul>\n\n<li><p>The <b>MakerNotes:ColorSpace<\/b> metadata reflects the setting\n(&#8220;sRGB&#8221; vs. &#8220;Adobe RGB&#8221;).<\/p><\/li>\n\n<li><p>The setting determines the color space for two JPEG images embedded\nwithin the NEF. <span class='nobr'>The embedded<\/span> JPEG images have no metadata of their own, so\nthe only indication of their color space is the NEF's\n<b>MakerNotes:ColorSpace<\/b> metadata.<\/p><\/li>\n\n<li><p>The setting determines the name of the NEF file: with sRGB, it's of\nthe pattern &#8220;DSC_0001.NEF&#8221;, and with Adobe RGB, it's of the\npattern &#8220;_DSC0001.NEF&#8221; (<small>see D200 manual, English\nversion, page 29<\/small>).<\/p><\/li>\n\n<\/ul>\n\n<p>Perhaps surprisingly, a NEF (at least <span class='nobr'>a D200<\/span>-produced NEF) contains two embedded JPEG images:<\/p>\n\n<ul><li><p>A small (570 &times; 375) &#8220;preview image&#8221;<\/p><\/li>\n\n<li><p>A full-frame (3,872 &times; 2,592) &#8220;JPEG from raw&#8221;\nimage, which is identical to the image inside <span class='nobr'>a Large<\/span>-size Basic-quality\nJPEG produced with the camera's JPEG Compression set to &#8220;Size\nPriority&#8221; (manual page 30).\n<\/p><\/li>\n<\/ul>\n\n<p>Together, the two embedded JPGs add about 9-10% to the size of a\n<a href=\"\/blog\/photo-tech\/nef-compression\/\">compressed NEF<\/a>.<\/p>\n\n<p>It's interesting to note that if you shoot both raw and JPEG at the same\ntime, you end up with <b>six<\/b> versions of the same picture, in two\nfiles:<\/p>\n\n\n<ol>\n<li>Raw full-frame sensor data in .NEF file<\/li>\n<li>Small (570 &times; 375) &#8220;preview image&#8221; JPEG embedded in the .NEF file<\/li>\n<li>Full-frame basic-quality size-priority-compression &#8220;JPEG from raw&#8221; embedded in the .NEF file<\/li>\n<li style='margin-top:10px'>Main JPEG image in the .JPG file whose size depends on the Image Size setting (manual page 32)<\/li>\n<li>Tiny (120 &times; 160) JPEG thumbnail embedded in the .JPG file<\/li>\n<li>Small (570 &times; 375) &#8220;preview image&#8221; embedded in the .JPG file<\/li>\n<\/ol>\n\n<p><span class='nobr'>Images 3<\/span> and 4 are identical if the camera is set to produce Large\nBasic-quality size-priority JPEGs. The resulting .JPG file has <span class='nobr'>a lot<\/span> of\nmetadata that the embedded &#8220;JPEG from raw&#8221; doesn't have, of\ncourse.<\/p>\n\n<p>\n\nIf you have Phil Harvey's most excellent <a\nhref=\"http:\/\/www.sno.phy.queensu.ca\/~phil\/exiftool\/\">ExifTool<\/a> (now\navailable in <span class='nobr'>a Windows<\/span> stand-alone executable), you can easily extract these embedded images:<\/p>\n\n<pre>\n  exiftool -b -PreviewImage   <i>file<\/i>.NEF &gt; <i>file<\/i>-Preview.jpg\n  exiftool -b -JpgFromRaw     <i>file<\/i>.NEF &gt; <i>file<\/i>-FromRaw.jpg\n  exiftool -b -PreviewImage   <i>file<\/i>.JPG &gt; <i>file<\/i>-Preview.jpg\n  exiftool -b -ThumbnailImage <i>file<\/i>.JPG &gt; <i>file<\/i>-Thumb.jpg\n<\/pre>\n\n<p>Again, be warned that none of these extracted images have any metadata,\nincluding an indication of their color space.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>This post is not likely of interest to regular readers of my blog (\"Hi Mom\"); I'm putting it here mostly for the search engines.<\/p> <p> A Nikon D200 dSLR has two color-space settings: sRGB and Adobe RGB. People often ask which should be selected when shooting in raw mode, with the oft-provided answer that \"it doesn't matter\" because raw data has its own camera-specific raw-sensor-data color space, and sRGB vs. AdobeRGB comes in to play only when converting the raw sensor data to a different image format (e.g. JPEG). <\/p><p> Indeed, the color-space setting doesn't matter for the main picture, [...]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,4],"tags":[],"_links":{"self":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts\/303"}],"collection":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/comments?post=303"}],"version-history":[{"count":0,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts\/303\/revisions"}],"wp:attachment":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/media?parent=303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/categories?post=303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/tags?post=303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}