{"id":238,"date":"2008-11-19T14:46:23","date_gmt":"2008-11-19T14:46:23","guid":{"rendered":"https:\/\/blogs.mathworks.com\/steve\/2008\/11\/19\/color-gamut-mapping\/"},"modified":"2013-10-29T14:43:24","modified_gmt":"2013-10-29T19:43:24","slug":"color-gamut-mapping","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/steve\/2008\/11\/19\/color-gamut-mapping\/","title":{"rendered":"Color Gamut Mapping"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <p>After <a href=\"https:\/\/blogs.mathworks.com\/steve\/2008\/11\/13\/icc-devcon-2008\/\">attending ICC DevCon 2008 last week<\/a> in Portland, Oregon, I stayed for another day to take a couple of short courses at the Color Imaging Conference. One of the\r\n      courses was Color Gamut Mapping, taught by J&aacute;n Morovic of Hewlett-Packard.  J&aacute;n is the author of the book <a href=\"http:\/\/www.amazon.com\/Mapping-Wiley-Imaging-Science-Technology\/dp\/0470030321\/\"><i>Color Gamut Mapping<\/i><\/a>, published this past summer. I didn't get a chance to look at the book, but I thought J&aacute;n's short course was quite good.\r\n   <\/p>\r\n   <p>Let me show you a couple of pictures to illustrate what I mean by color gamut mapping.<\/p>\r\n   <p>The first is a sample color image that ships with the Image Processing Toolbox (peppers.png):<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2008\/peppers.jpg\"> <\/p>\r\n   <p>The second image simulates what the first might look like if printed in a newspaper:<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2008\/peppers-newsprint-perceptual.jpg\"> <\/p>\r\n   <p>(The process of simulating the appearance of hardcopy output on a computer monitor is called <i>soft proofing<\/i>.)\r\n   <\/p>\r\n   <p>The two images look substantially different because many colors that can be displayed on a typical computer monitor cannot\r\n      be exactly reproduced on newsprint.  We say that the monitor and the newsprint have different <i>color gamuts<\/i>, and the process of mapping monitor colors to newsprint colors is <i>color gamut mapping<\/i>.\r\n   <\/p>\r\n   <p>J&aacute;n provided more precise definitions of these terms from CIE and ISO:<\/p>\r\n   <p><b>Colour gamut:<\/b> a range of colours achievable on a given colour reproduction medium [...] under a given set of viewing conditions - it is\r\n      a volume in colour space. (CIE, 2004d, pp. 2)\r\n   <\/p>\r\n   <p><b>Gamut mapping:<\/b> mapping of the colour-space coordinates of the elements of a source image to colour-space coordinates of the elements of\r\n      a reproduction to compensate for differences in the source and output medium colur gamut capability. (ISO 22028-1:2004)\r\n   <\/p>\r\n   <p>Color science presentations all seem to spend a lot of time on definitions! That's probably because there is often much confusion\r\n      and disagreement over them.\r\n   <\/p>\r\n   <p>Notice that the definition of color gamut refers to both the reproduction medium (characteristics of paper, inks, etc.) and\r\n      the viewing conditions (such as the level and type of ambient light).  One of my favorite quotes of the conference was from\r\n      J&aacute;n: \"In complete darkness all prints have the same gamut.\"\r\n   <\/p>\r\n   <p>Different gamut mapping methods have different aims.  For example, in some situations you might want to preserve the colors\r\n      that are in both the source and the destination gamuts.  Below is a soft proof of such a mapping.\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2008\/peppers-newsprint-relative-colorimetric.jpg\"> <\/p>\r\n   <p>This soft proof exhibits considerable clipping and loss of detail.  That's because the goal of preserving in-gamut colors\r\n      limits our ability to adjust the out-of-gamut colors in a pleasing way. On the other hand, the first soft proof shown above\r\n      uses a different gamut mapping method that adjusts both in-gamut and out-of-gamut colors in order to produce a result that's\r\n      more \"pleasing.\"\r\n   <\/p>\r\n   <p>I'm working on a new example using ICC profiles and different <i>rendering intents<\/i>.  That example will show how I created the soft proofs above using Image Processing Toolbox functions.  I'll post it soon.\r\n   <\/p>\r\n   <p>I'll leave you with a new word I learned in the course. J&aacute;n talked about the difference between a person's verbal description\r\n      of a perception (such as color), and the perceptual experience itself.  The verbal description is only a very indirect representation\r\n      of the experience.  In that context, J&aacute;n taught us the word <i>ekphrasis<\/i>, which refers to a rhetorical description of a visual work of art, like a poem about a sculpture.\r\n   <\/p>\r\n   <p>There you go - a little Greek education to mix in with your dose of image processing for the day.<\/p>\r\n\r\n<p>\r\n<em>Note added 29-Oct-2013:<\/em> Please visit the <a href=\"https:\/\/www.mathworks.com\/discovery\/color-profile.html\">discovery page on Color Profiles<\/a> for more information on color processing with MATLAB.\r\n<\/p>\r\n\r\n<script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_2564d9bbdbf044fa902396ceced36afb() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='2564d9bbdbf044fa902396ceced36afb ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 2564d9bbdbf044fa902396ceced36afb';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Steve Eddins';\r\n        copyright = 'Copyright 2008 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_2564d9bbdbf044fa902396ceced36afb()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.7<br><\/p>\r\n<\/div>\r\n<!--\r\n2564d9bbdbf044fa902396ceced36afb ##### SOURCE BEGIN #####\r\n%%\r\n% After <https:\/\/blogs.mathworks.com\/steve\/2008\/11\/13\/icc-devcon-2008\/ \r\n% attending ICC DevCon 2008 last week> in Portland, Oregon, I stayed for\r\n% another day to take a couple of short courses at the Color Imaging Conference.\r\n% One of the courses was Color Gamut Mapping, taught by J\u00c3\u00a1n Morovi?\r\n% of Hewlett-Packard.  J\u00c3\u00a1n is the author of the book\r\n% <http:\/\/www.amazon.com\/Mapping-Wiley-Imaging-Science-Technology\/dp\/0470030321\/\r\n% _Color Gamut Mapping_>, published this past summer. I didn't get a chance to\r\n% look at the book, but I thought J\u00c3\u00a1n's short course was quite good.\r\n%\r\n% Let me show you a couple of pictures to illustrate what I mean by color\r\n% gamut mapping.\r\n%\r\n% The first is a sample color image that ships with the Image Processing Toolbox\r\n% (peppers.png):\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2008\/peppers.jpg>>\r\n%\r\n% The second image simulates what the first might look like if printed in a\r\n% newspaper:\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2008\/peppers-newsprint-perceptual.jpg>>\r\n%\r\n% (The process of simulating the appearance of hardcopy output on a computer\r\n% monitor is called _soft proofing_.)\r\n%\r\n% The two images look substantially different because many colors that can be\r\n% displayed on a typical computer monitor cannot be exactly reproduced on\r\n% newsprint.  We say that the monitor and the newsprint have different _color\r\n% gamuts_, and the process of mapping monitor colors to newsprint colors is\r\n% _color gamut mapping_.\r\n%\r\n% J\u00c3\u00a1n provided more precise definitions of these terms from CIE and ISO:\r\n%\r\n% *Colour gamut:* a range of colours achievable on a given colour reproduction\r\n% medium [...] under a given set of viewing conditions - it is a volume in\r\n% colour space. (CIE, 2004d, pp. 2)\r\n%\r\n% *Gamut mapping:* mapping of the colour-space coordinates of the elements of\r\n% a source image to colour-space coordinates of the elements of a reproduction\r\n% to compensate for differences in the source and output medium colur gamut\r\n% capability. (ISO 22028-1:2004)\r\n%\r\n% Color science presentations all seem to spend a lot of time on\r\n% definitions! That's probably because there is often much confusion and\r\n% disagreement over them. \r\n%\r\n% Notice that the definition of color gamut refers to both the reproduction\r\n% medium (characteristics of paper, inks, etc.) and the viewing conditions\r\n% (such as the level and type of ambient light).  One of my favorite quotes of the\r\n% conference was from J\u00c3\u00a1n: \"In complete darkness all prints have the same\r\n% gamut.\"\r\n%\r\n% Different gamut mapping methods have different aims.  For example, in some\r\n% situations you might want to preserve the colors that are in both the\r\n% source and the destination gamuts.  Below is a soft proof of such a mapping. \r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2008\/peppers-newsprint-relative-colorimetric.jpg>>\r\n%\r\n% This soft proof exhibits considerable clipping and loss of detail.  That's\r\n% because the goal of preserving in-gamut colors limits our ability to adjust\r\n% the out-of-gamut colors in a pleasing way. On the other hand, the first soft\r\n% proof shown above uses a different gamut mapping method that adjusts both\r\n% in-gamut and out-of-gamut colors in order to produce a result that's more\r\n% \"pleasing.\"\r\n%\r\n% I'm working on a new example using ICC profiles and different _rendering \r\n% intents_.  That example will show how I created the soft proofs above using\r\n% Image Processing Toolbox functions.  I'll post it soon.\r\n%\r\n% I'll leave you with a new word I learned in the course. J\u00c3\u00a1n talked about the difference\r\n% between a person's verbal description of a perception (such as color), and the\r\n% perceptual experience itself.  The verbal description is only a very\r\n% indirect representation of the experience.  In that context, J\u00c3\u00a1n taught us the\r\n% word _ekphrasis_, which refers to a rhetorical description of a visual work of\r\n% art, like a poem about a sculpture.\r\n%\r\n% There you go - a little Greek education to mix in with your dose of image\r\n% processing for the day.\r\n##### SOURCE END ##### 2564d9bbdbf044fa902396ceced36afb\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   After attending ICC DevCon 2008 last week in Portland, Oregon, I stayed for another day to take a couple of short courses at the Color Imaging Conference. One of the\r\n      courses was Color... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/steve\/2008\/11\/19\/color-gamut-mapping\/\">read more >><\/a><\/p>","protected":false},"author":42,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/238"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/comments?post=238"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/238\/revisions"}],"predecessor-version":[{"id":910,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/238\/revisions\/910"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/media?parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/categories?post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/tags?post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}