{"id":568,"date":"2024-10-20T19:39:07","date_gmt":"2024-10-20T19:39:07","guid":{"rendered":"https:\/\/valleau.art\/blog\/?p=568"},"modified":"2025-05-23T17:50:24","modified_gmt":"2025-05-23T17:50:24","slug":"about-camera-raw-files-2","status":"publish","type":"post","link":"https:\/\/valleau.art\/blog\/about-camera-raw-files-2\/","title":{"rendered":"What is a camera raw file?"},"content":{"rendered":"<p style=\"font-size: 16px;\">I recent ran across someone who didn&#8217;t understand what a raw file is, and had it confused with an image file.<\/p>\n<p style=\"font-size: 16px;\">So, let&#8217;s take a quick look at it.<\/p>\n<p style=\"font-size: 16px;\">Perhaps you&#8217;re old enough to remember the Weston Lightmeter:<\/p>\n<p style=\"font-size: 16px;\"><img loading=\"lazy\" decoding=\"async\" style=\"display: block; margin-left: auto; margin-right: auto;\" title=\"Weston meter.jpg\" src=\"https:\/\/valleau.art\/blog\/wp-content\/uploads\/2025\/05\/Weston-meter-1.jpg\" alt=\"Weston meter.\" width=\"146\" height=\"144\" border=\"0\" \/><\/p>\n<p style=\"font-size: 16px;\">It had a &#8220;photovoltaic cell&#8221; (don&#8217;t panic) which is simply some goop which when exposed to light generates a very tiny electrical current. The brighter the light, the greater the current, and the greater the current, the farther the little needle on the display would swing to the right. Underneath the needle is a printed chart, with numbers, so your light meter reading was simply the number that was underneath the needle when it stopped moving.<\/p>\n<p style=\"font-size: 16px;\">In other words, the light meter effectively measured the &#8220;luminosity&#8221; (intensity\/brightness of the light) in any given environment.<\/p>\n<p style=\"font-size: 16px;\">Now, if you were to cover the front of the meter, where the photovoltaic cell lives, with say blue cellophane, then only the blue light would enter, and you&#8217;d be measuring the luminosity of the blue light only. If you wanted to know the luminosity of only the green or red part of the spectrum, you&#8217;d just cover the cell with green (or red) cellophane.<\/p>\n<p style=\"font-size: 16px;\">OK: simple enough&#8230; but <em>that is exactly how your digital camera captures the data it needs to (later) make an image<\/em>.<\/p>\n<p style=\"font-size: 16px;\">The sensor in your camera, which gets exposed to light when you push the shutter release button, is (in the miracle of modern technology) covered in a checker-board pattern, with literally millions of &#8220;little Weston meters&#8221;&#8230; and each one has a piece of colored cellophane (aka a &#8220;filter&#8221;) on it, either red or green or blue. (The actual arrangement of those filters is called a Bayer pattern.) \u00a0Here&#8217;s what it looks like:<\/p>\n<p style=\"font-size: 16px;\"><img loading=\"lazy\" decoding=\"async\" style=\"display: block; margin-left: auto; margin-right: auto;\" title=\"CleanShot 2025-05-23 at 10.38.50.jpg\" src=\"https:\/\/valleau.art\/blog\/wp-content\/uploads\/2025\/05\/CleanShot-2025-05-23-at-10.38.50.jpg\" alt=\"CleanShot 2025-05-23 at 10.38.50.\" width=\"346\" height=\"225\" border=\"0\" \/><\/p>\n<p style=\"font-size: 16px;\">So, when the sensor is exposed to light, each sensor cell records a single number that is relative to the intensity of light at that location on the sensor. In the image above, that would look like this:<\/p>\n<p style=\"font-size: 16px;\">(I&#8217;m making up the numbers, of course, for this example&gt;)<\/p>\n<p style=\"font-size: 16px;\">(Row 1) \u00a0 green = 300 \u00a0 \u00a0red = 55 \u00a0green = 340 \u00a0 red = 66\u00a0<\/p>\n<p style=\"font-size: 16px;\">(Row 2) \u00a0blue = 4000 \u00a0 green = 421 \u00a0blue \u00a0= 3980 \u00a0green = 345<\/p>\n<p style=\"font-size: 16px;\">(Row 3) \u00a0green = 298 \u00a0 \u00a0red = 66 \u00a0green = 302 \u00a0 red = 75<\/p>\n<p style=\"font-size: 16px;\">(Row 4) \u00a0blue = 4100 \u00a0 green = 407 \u00a0blue \u00a0= 4009 \u00a0green = 301<\/p>\n<p style=\"font-size: 16px;\">If you were going to save those 16 cells (or all \u00a0millions of them) to memory or on a disk, the data for that group, as seen in the recording, would be:<\/p>\n<p style=\"font-size: 16px;\">300 55 340 66 <br \/>4000 4213 980 345 <br \/>298 66 302 75 <br \/>4100 407 4009 301<\/p>\n<p style=\"font-size: 16px;\">or really more like this, all run together:<\/p>\n<p style=\"font-size: 16px;\">300 55 340 66 4000 4213 980 345 298 66 302 75 4100 407 4009 301<\/p>\n<p style=\"font-size: 16px;\">Those individual cells are called &#8220;photosites&#8221; or sometimes &#8220;sensels&#8221;, but you&#8217;ll notice that <em>each one records the intensity of only <strong>one<\/strong> color<\/em>. The whole thing is called a &#8220;mosaic&#8221; since that&#8217;s what it looks like. \u00a0They are NOT called &#8220;pixels&#8221; \u00a0(which are on your monitor or printed photography because &#8220;pixel&#8221; is from an image, and <em>is a single cell<\/em> <em>with all three values<\/em>, red, green and blue, so that you get full color in each place, not just one color.)<\/p>\n<p style=\"font-size: 16px;\">That is what a &#8216;raw&#8217; (which means not finished, or not cooked if you prefer) file is: a long string of numbers representing the luminosity intensity values straight from the camera sensor.<\/p>\n<p style=\"font-size: 16px;\">&#8212;-<\/p>\n<p style=\"font-size: 16px;\">Obviously however, that&#8217;s not an image &#8211; it&#8217;s just a bunch of data. Even more apparent is that each cell as recorded is not &#8220;full color&#8221; but only the intensity of red, green or blue.<\/p>\n<p style=\"font-size: 16px;\">Where does the full color image (with a lot more colors than only red, green or blue) come from?<\/p>\n<p style=\"font-size: 16px;\">Computer magic: that mosaic is run through software which &#8220;demosaics&#8221; it. The software looks at all the surrounding cells, RGB, \u00a0and extrapolates (figures out) what the full color of each pixel (now is the time to call it a pixel) <em>should<\/em> be, and saves each cell with three numbers: a value for red, a value for blue, and a value for green. A pixel is a &#8220;picture element&#8221; which has a RGB component to it.<\/p>\n<p style=\"font-size: 16px;\">The data might look like this:<\/p>\n<p style=\"font-size: 16px;\">(Row 1, Cell 1) \u00a0 \u00a0 red = 255 \u00a0green = 133 \u00a0 blue = 18<\/p>\n<p style=\"font-size: 16px;\">(Row 1, Cell 2) \u00a0 \u00a0 red = 255 \u00a0green = 131 \u00a0 blue = 19<\/p>\n<p style=\"font-size: 16px;\">(Row 1, Cell 3) \u00a0 \u00a0 red = 254 \u00a0green = 136 \u00a0 blue = 21<\/p>\n<p style=\"font-size: 16px;\">(Row 1, Cell 4) \u00a0 \u00a0 red = 253 \u00a0green = 140 \u00a0 blue = 22<\/p>\n<p style=\"font-size: 16px;\">or those 4 cells just from Row 1 above:<\/p>\n<p style=\"font-size: 16px;\">255 133 18 <br \/>255 131 19 <br \/>254 136 21 <br \/>253 140 22<\/p>\n<p style=\"font-size: 16px;\">aka<\/p>\n<p style=\"font-size: 16px;\">255 133 18 255 131 19 254 136 21 253 140 22<\/p>\n<p style=\"font-size: 16px;\">In the image file, instead of <em>one<\/em> number per cell, \u00a0there are now <em>three numbers per cell<\/em> representing the full R, G, B value of that single pixel.<\/p>\n<p style=\"font-size: 16px;\">After fully demosaicing the data from the sensor\/raw file (<em>which itself remains unchanged<\/em> ) those extrapolated values are <em>saved into a new, different and familiar &#8220;image&#8221; file<\/em>, such as a jpg or tif. Now you have two files: a raw file (in which the original data is unchanged) and a new image file (full \u00a0of new data).<\/p>\n<p style=\"font-size: 16px;\">Let&#8217;s say you have a bag of groceries, including, flour, eggs, sugar and milk.<\/p>\n<p style=\"font-size: 16px;\">A &#8220;raw&#8221; file is more like the bag of uncooked groceries, while an &#8220;image&#8221; file is more like a finished cake.<\/p>\n<p style=\"font-size: 16px;\">\u00a0<\/p>\n<p style=\"font-size: 16px;\">Well, that&#8217;s the gist of it. Vastly oversimplified of course, \u00a0but that&#8217;s basically how it all works.<\/p>\n<p style=\"font-size: 16px;\">HTH<\/p>\n<p style=\"font-size: 16px;\">\u00a0<\/p>\n<p style=\"font-size: 16px;\">addendum:<\/p>\n<p style=\"font-size: 16px;\">about editing a raw file: You don&#8217;t. The raw file data remains the same. The changes are applied when you demosaic the raw file into a bit-map file.<\/p>\n<p style=\"font-size: 16px;\">In digital photography, the &#8220;sidecar&#8221; file associated with a raw image file typically contains metadata and adjustments made to the image, including exposure adjustments, white balance, and other non-destructive edits. The sidecar file is often in XML format (commonly using the .xmp extension) and is separate from the original raw image file.<\/p>\n<p style=\"font-size: 16px;\">The sidecar file records the changes you&#8217;ve made to the image in your editing software without altering the original RAW data. When you open the raw file in the same or compatible software, these adjustments are applied according to the information stored in the sidecar file. This allows for flexibility, as you can adjust or revert changes without losing any original image data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recent ran across someone who didn&#8217;t understand what a raw file is, and had it confused with an image file. So, let&#8217;s take a quick look at it. Perhaps you&#8217;re old enough to remember the Weston Lightmeter: It had a &#8220;photovoltaic cell&#8221; (don&#8217;t panic) which is simply some goop which when exposed to light [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3,4],"tags":[],"class_list":["post-568","post","type-post","status-publish","format-standard","hentry","category-general-info","category-photo","category-mac-tips"],"_links":{"self":[{"href":"https:\/\/valleau.art\/blog\/wp-json\/wp\/v2\/posts\/568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/valleau.art\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/valleau.art\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/valleau.art\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/valleau.art\/blog\/wp-json\/wp\/v2\/comments?post=568"}],"version-history":[{"count":4,"href":"https:\/\/valleau.art\/blog\/wp-json\/wp\/v2\/posts\/568\/revisions"}],"predecessor-version":[{"id":608,"href":"https:\/\/valleau.art\/blog\/wp-json\/wp\/v2\/posts\/568\/revisions\/608"}],"wp:attachment":[{"href":"https:\/\/valleau.art\/blog\/wp-json\/wp\/v2\/media?parent=568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/valleau.art\/blog\/wp-json\/wp\/v2\/categories?post=568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/valleau.art\/blog\/wp-json\/wp\/v2\/tags?post=568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}