{"id":252,"date":"2006-10-03T17:45:30","date_gmt":"2006-10-03T08:45:30","guid":{"rendered":"https:\/\/regex.info\/blog\/photo-tech\/color-spaces-page1"},"modified":"2006-09-25T22:23:35","modified_gmt":"2006-09-25T13:23:35","slug":"color-spaces-page1","status":"publish","type":"page","link":"https:\/\/regex.info\/blog\/photo-tech\/color-spaces-page1","title":{"rendered":"Digital-Image Color Spaces, Page 1: Introduction"},"content":{"rendered":"\n\n<style type='text\/css'>\na.btn    { background-color: #555; border: solid 1px #888; padding: 2px 5px }\nspan.now { background-color: #533; border: solid 1px #888; padding: 2px 5px; font-weight: bold }\n<\/style>\n<div style='display: block; background-color: #444; padding: 7px; border: solid 2px gray'>\n<b>Article:<\/b>\n<a class='btn' href='\/blog\/photo-tech\/color-spaces-page0\/'>Table of Contents<\/a> &nbsp; &nbsp; &nbsp; <b>Page:<\/b>\n<span class='now'>1<\/span> &middot;\n<a title='Test Images'               class='btn' href='\/blog\/photo-tech\/color-spaces-page2\/'>2<\/a> &middot;\n<a title='Color Mis-Management'      class='btn' href='\/blog\/photo-tech\/color-spaces-page3\/'>3<\/a> &middot;\n<a title='Color Mangement'           class='btn' href='\/blog\/photo-tech\/color-spaces-page4\/'>4<\/a> &middot;\n<a title='Chromaticity Diagrams'     class='btn' href='\/blog\/photo-tech\/color-spaces-page5\/'>5<\/a> &middot;\n<a title='Design Tradeoffs'          class='btn' href='\/blog\/photo-tech\/color-spaces-page6\/'>6<\/a> &middot;\n<a title='Recommendations and Links' class='btn' href='\/blog\/photo-tech\/color-spaces-page7\/'>7<\/a>\n<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is the first page of a seven-page article<\/small>\n<\/div>\n\n<p><a name='Prolog'><b>Prolog<\/b><\/a><\/p>\n<p>\n\nThere are multiple ways to interpret a number as a speed: &#8220;65&#8221;\nin miles\/hour is highway cruising speed, but &#8220;65&#8221; in knots on the highway is a\nspeeding ticket, while &#8220;65&#8221; in kilometers\/hour is only half\nthat speed. &#8220;65&#8221; in meters\/second is a category-4 hurricane,\nand &#8220;65&#8221; in Mach is faster than a meteor.\n\n<\/p><p>\n\nClearly, when discussing speed, it's important to know not only the raw\nnumber, but also the scale in which to interpret it.\n\n<\/p>\n<p><a name='Introduction'><b>Introduction<\/b><\/a><\/p>\n<p>\n\nWhen it comes to representing color, the digital-image version of this kind\nof scale is its <b>color space<\/b>. A digital-image file is made up of raw\nnumeric data &mdash; data that is not &#8220;color,&#8221; but numbers\nrepresenting color. There are actually many different ways to represent color with\nnumbers in an image file; if an application processing an image file\ndoesn't know <i>which<\/i> scale was used in creating the image's raw\nnumeric color data (and if it isn't able to guess correctly), it doesn't\nknow how to properly recreate the color when printing or displaying the\nimage. The result is an image with wrong colors, like a TV whose\n&#8220;tint&#8221; setting is way out of wack.\n\n<\/p>\n\n<p><a name='Example'>Here's an example (me and my son, neither of whom are supposed to be green!):<\/a><\/p>\n\n<table cellpadding='10' style='margin-top:10px; margin-bottom: 20px; border: solid gray 2px; padding:20px'><tr>\n  <td align='center'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/cs\/sample-okay.jpg\" width=\"330\" height=\"221\" alt='image whose color space is recognized and understood'\/><p><b>Color Data Properly Interpreted<\/b><\/p><\/td>\n\n<td align='center'><img loading=\"lazy\" decoding=\"async\" src=\"\/i\/cs\/sample-wonky.jpg\" width=\"330\" height=\"221\" alt='image created with a crazy color space, but without an embedded color pfoile, so it looks wonky'\/><p><b>Color Data Misinterpreted<\/b><\/p><\/td>\n<\/tr>\n\n<\/table>\n\n<p>\n\nSo, a color space is a set of parameters that describe how to convert\nbetween numbers and real-world colors. Different color spaces mean\ndifferent conversions: different real-world colors from the same number, or\ndifferent numbers from the same real-world color. The technical details are\ndiscussed later in the article; for the moment, just consider them\nabstractly.\n\n<\/p>\n\n\n<p><a name='FileFormats'><b>File Formats are an Unrelated Topic<\/b><\/a><\/p>\n<p>\n\nTo be clear, the concept of a <b>color space<\/b> is different from a\n<b>file format<\/b>. Many image file formats (such as JPEG, TIFF, DNG, etc.)\nhave the ability to use different color spaces &mdash; different ways to\nencode the image color &mdash; for their raw numeric data. You can think of\na file format as being a standard for how to arrange image data\n(&#8220;such-and-such metadata is allowed, the image is composed of lines\nof pixels arranged this-and-that way, using such-and-such compression and\ninterleaving....&#8221;) and a color space describes how to interpret the\nper-pixel data into light.\n\n<\/p><p>\n\n<a name='soundspace'>Using music files as an analogy, the &#8220;sound\nspace&#8221; would be a<\/a> set of parameters such as the minimum and\nmaximum frequency that can be encoded, the range of amplitudes (volume)\nthat can be encoded, and the mathematical parameters for how the smooth\nrange of encodable real-world frequencies and amplitudes are converted to\ndiscrete, raw numeric data.\n\n<\/p>\n\n\n<p><a name='sRGB'><b>Color-Space Basics: &#8220;sRGB&#8221;<\/b><\/a><\/p>\n\n<p>\n\nThe most commonly-used color space is called &#8220;sRGB,&#8221; which has\none overwhelmingly important characteristic: <i>it's the most commonly-used\ncolor space<\/i>. Just about every scanner and digital camera can produce\nimages with sRGB-encoded color. Just about every image-handling device\n(like printer) and color-aware application (photo editor) can handle images\nwith sRGB-encoded color. In fact, it's the de facto default color space for\nimage input and output of most devices and applications (at least those\nthat understand color spaces). It's the official default color space for\nthe World Wide Web.\n\n<\/p><p>\n\nThe ubiquity of the sRGB color space is really quite convenient.\n\n<\/p><p>\n\nBecause things that produce images <font color='gray'>(digital cameras,\nscanners, image-editing software, ....)<\/font> are on the same color-space\nwavelength, so to speak, as many things that process or display images\n<font color='gray'>(printers, image-viewing software, ...)<\/font>, colors\nare generally encoded and decoded reasonably well. What you see is not only\nwhat you get, but what you're <i>supposed<\/i> to get.\n\n<\/p><p>\n\nSo, in the face of this overwhelming ubiquity, why would anyone even bother\nusing a different color space for a digital image? (That is, a different\nmethod to encode colors with numbers within the raw image data?)\n\n<\/p>\n\n<p><a name='Tradeoffs'><b>Color-Space Tradeoffs<\/b><\/a><\/p>\n\n<p>\n\nFor technical reasons discussed later in this article, the design of a\ncolor space necessarily involves tradeoffs among various aspects of image\nquality. For example, it might be surprising to learn that it's impossible\nfor a color space to represent all the colors that a human eye can discern,\nand so some subtle shades must necessarily be omitted (if an image's true\ncolor is one of the omitted shades, the encoded color becomes one that's\nclose &mdash; usually very, very close &mdash; to the true color). So,\n<i>which<\/i> shades are included and excluded is one aspect that makes a\ncolor space more or less appealing to certain users or artistic tastes.\n\n<\/p><p>\n\nThe <a href='\/blog\/photo-tech\/color-spaces-page2\/'>next page of\nthis article<\/a> offers a few more technical details about color spaces and\ntheir relative merits, but the main point of this article is merely to\nintroduce the concept of color spaces &mdash; ways to convert colors to and from\nraw numeric data &mdash; and why it's important for the photographer to know\nabout them.\n\n<\/p>\n<p><a name='Profiles'><b>Color Profiles<\/b><\/a><\/p>\n<p>\n\nWhen a different color space is used to encode the raw image data, the\nresulting data is still just a bunch of raw numbers, so how does a printer\nor application know that it should consider it in the light of something\nother than sRGB (or whatever its default color space is)? The answer is\nusually found in the form of an embedded color profile.\n\n<\/p><p>\n\nA <b>color profile<\/b> for a color space is the aforementioned set of\nparameters that describe the color space, arranged in a standardized way so\nthat they can be communicated along with an image. It can be embedded\nwithin a digital image file as metadata, along the same lines as how the\ndate and time are included with the image. This conveniently allows a\nprinter, image-display software, or other color-aware device\/application\nthat receives the image file to know the particulars of the color space so\nthat it can properly decode the colors. (If an image doesn't have an\nembedded color profile, most devices go ahead and decode the colors using\nthe parameters of the sRGB color-space.)\n\n<\/p><p>\n\nWithout the proper color profile associated with the color space used to\ncreate the image data, applications don't know how to decode the color\ndata. This results in mixed up or &#8220;off&#8221; colors, like the\n&#8220;color data misinterpreted&#8221; image shown above. That example, by\nthe way, is not a simulation, but an image that looks perfectly normal when\ninterpreted using the proper color space. To ensure that you'd see the\nwrong colors, I manually removed the embedded color profile from the image\nfile, knowing that your browser would then misinterpret the color data.\n\n<\/p>\n<p><a name='Test'><b>Color Profiles Don't Always Get The Respect They Deserve<\/b><\/a><\/p>\n<p>\n\nYou might be surprised to find out what happens when I do go ahead and\ninclude the proper color profile along with the image, as I do with the\nmiddle image here:<\/p>\n\n<table cellpadding='5' style='margin-top: 10px; margin-bottom: 20px; border: solid gray 1px; padding: 10px 10px 0 10px'><tr valign='top'>\n\n<td  valign='middle' style='background-color:#CFC' align='center' width='230'><img loading=\"lazy\" decoding=\"async\" noindex src=\"\/i\/cs\/sample-okay.jpg\" width=\"100\" height=\"67\" alt='image whose color space is recognized and understood'\/><br\/><b style='color:black'>Correct<\/b><\/td>\n\n<td  valign='middle' style='border: solid 3px black' align='center' width='230'><img loading=\"lazy\" decoding=\"async\" noindex src=\"\/i\/cs\/sample-wonky.profile.jpg\" width=\"220\" height=\"147\" alt='image with crazy color space, and an embedded color\nprofile to match'\/><br\/><b>Correct or Wrong?<\/b><\/td>\n\n<td valign='middle' style='background-color:#FAA' align='center' width='230'><img loading=\"lazy\" decoding=\"async\" noindex src=\"\/i\/cs\/sample-wonky.jpg\" width=\"100\" height=\"67\" alt='image created with a crazy color space, but without an embedded color\npfoile, so it looks wonky'\/><br\/><b style='color:black'>Wrong<\/b><\/td>\n\n<\/tr>\n\n<tr><td colspan='3'><small>(For your reference, here is the <a\nhref='\/i\/cs\/MySuperFunkyRGB.icc'>color profile<\/a> for the color space used for\nthe center and right-side images.)<\/small><\/td><\/tr>\n\n<\/table>\n\n\n<p>Does the middle image look okay or wrong? It depends on how\ncolormetrically-enlightened your browser is:<\/p>\n\n<ul>\n  <li><p><b>Middle Image Looks Okay:<\/b> your browser recognizes and respects an image's embedded color profile. Congratulations!<\/p><\/li>\n\n  <li><p><b>Middle Image Looks Wrong:<\/b> your browser does not recognize\n       or respect an image's embedded color profile. How unsociable!<\/p><\/li>\n\n<\/ul>\n\n<p>And herein lies the problem: <b>many browsers are not &#8220;color\nmanaged&#8221;<\/b> applications, meaning that they do not know how to\nrecognize or understand color profiles.<\/p>\n\n<p>We'll talk much more about color management later, but first let's look\nat just how wrong the colors can be in a real-world situation. When\ncreating the sample images shown above, I purposefully used a color space\nwildly different from sRGB &mdash; one that I made up just for this purpose\n&mdash; so that the &#8220;wrongness&#8221; would be exaggerated and\nobviously apparent at first glance.<\/p>\n\n<p>The next page of this article shows a variety of photos encoded with\nreal-world color spaces (color spaces named <i>AdobeRGB<\/i>,\n<i>ColorMatch<\/i>, <i>ProPhoto<\/i>, <i>WideRGB<\/i>, and <i>AppleRGB<\/i>)\nbut without an embedded profile, allowing you to see real-world effects of\nmisinterpreted color.\n\n<\/p>\n<p><b>Continued on the Next Page<\/b><\/p>\n<p>\nThis article continues on <a href='\/blog\/photo-tech\/color-spaces-page2\/'>Page 2: Test Images<\/a>.\n<\/p>\n\n\n\n\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p><b>Prolog<\/b><\/p> <p> There are multiple ways to interpret a number as a speed: \"65\" in miles\/hour is highway cruising speed, but \"65\" in knots on the highway is a speeding ticket, while \"65\" in kilometers\/hour is only half that speed. \"65\" in meters\/second is a category-4 hurricane, and \"65\" in Mach is faster than a meteor. <\/p><p> Clearly, when discussing speed, it's important to know not only the raw number, but also the scale in which to interpret it. <\/p> <p><b>Introduction<\/b><\/p> <p> When it comes to representing color, the digital-image version of this kind of scale is its <b>color space<\/b>. [...]","protected":false},"author":1,"featured_media":0,"parent":251,"menu_order":1,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/252"}],"collection":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/types\/page"}],"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=252"}],"version-history":[{"count":0,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/252\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/pages\/251"}],"wp:attachment":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/media?parent=252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}