{"id":65,"date":"2006-06-19T16:53:04","date_gmt":"2006-06-19T20:53:04","guid":{"rendered":"https:\/\/blogs.mathworks.com\/steve\/?p=65"},"modified":"2019-10-22T12:30:29","modified_gmt":"2019-10-22T16:30:29","slug":"hue-shifts-near-the-l0-axis","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/steve\/2006\/06\/19\/hue-shifts-near-the-l0-axis\/","title":{"rendered":"Hue shifts near the L*=0 axis"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <p>At the European Colour in Graphics, Imaging, and Vision conference today, I took a tutorial called \"Transforms for Colour and Spectral Reproduction.\" Mitch Rosen of the Munsell Color Science\r\n      Laboratory, Rochester Institute of Technology, taught the class.\r\n   <\/p>\r\n   <p>Mitch's topics included how to solve inverse problems in order to construct multidimensional lookup tables that transform\r\n      colors from one space to another.  One comment caught my ear - small approximation errors in these lookup tables can be relatively\r\n      worse for colors that are neutral (gray) or near-neutral.\r\n   <\/p>\r\n   <p>Let's explore this idea using the L*a*b* color space.  L* is lightness, while a* and b* represent red-green and yellow-blue\r\n      color differences, respectively.  Colors for which a* and b* equal zero are neutral, or gray.\r\n   <\/p>\r\n   <p>First let's look at a pair of reds that have the same luminance, and are separated by a distance of 20 in the a*-b* plane.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">L = 85;\r\na = 70;\r\nb = 0;\r\n\r\nlab1 = [L a b];\r\nlab2 = [L a+20 b];<\/pre><p>Now convert these colors to sRGB space and display each as a single-pixel image.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">cform = makecform(<span style=\"color: #A020F0\">'lab2srgb'<\/span>);\r\nrgb1 = applycform(lab1, cform);\r\nrgb2 = applycform(lab2, cform);\r\n\r\nsubplot(1,2,1)\r\nimshow(reshape(rgb1,1,1,3))\r\ntitle(<span style=\"color: #A020F0\">'L*a*b* = [85 70 0]'<\/span>)\r\n\r\nsubplot(1,2,2)\r\nimshow(reshape(rgb2,1,1,3))\r\ntitle(<span style=\"color: #A020F0\">'L*a*b* = [85 90 0]'<\/span>)\r\n\r\nset(gcf, <span style=\"color: #A020F0\">'Color'<\/span>, <span style=\"color: #A020F0\">'w'<\/span>)<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/65\/green_pink_01.png\"> <p>These colors are visibly different, but they have the same basic hue.<\/p>\r\n   <p>Now let's try the same thing with colors that are the same distance apart, but which are located close to the neutral axis.<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">lab3 = [85 10 0];\r\nlab4 = [85 -10 0];\r\n\r\nrgb3 = applycform(lab3, cform);\r\nrgb4 = applycform(lab4, cform);\r\n\r\nsubplot(1,2,1)\r\nimshow(reshape(rgb3,1,1,3))\r\ntitle(<span style=\"color: #A020F0\">'L*a*b* = [85 10 0]'<\/span>)\r\n\r\nsubplot(1,2,2)\r\nimshow(reshape(rgb4,1,1,3))\r\ntitle(<span style=\"color: #A020F0\">'L*a*b* = [85 -10 0]'<\/span>)\r\n\r\nset(gcf, <span style=\"color: #A020F0\">'Color'<\/span>, <span style=\"color: #A020F0\">'w'<\/span>)<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/65\/green_pink_02.png\"> <p>These colors have a distinctively different hue - one is pink and the other is green.  The moral of the story is that \"small\"\r\n      changes in a*-b* are more likely to produce dramatic hue shifts for colors close to the L*=0 axis.\r\n   <\/p>\r\n   <p>Conference quote of the day: \"In color science, if you want a real controversy, start a terminology discussion.\" <i>- Jack Holm, Hewlett-Packard<\/i><\/p>\r\n<script language=\"JavaScript\"> \r\n<!--\r\n    function grabCode_65() {\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='65 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 65';\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 2006 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      <\/script>\r\n<noscript>\r\n<em>A JavaScript-enabled browser is required to use the \"Get the MATLAB code\" link.<\/em>\r\n<\/noscript>\r\n<p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_65()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code<\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.2<br><\/p>\r\n<\/div>\r\n<!--\r\n65 ##### SOURCE BEGIN #####\r\n%%\r\n% At the <http:\/\/www.imaging.org\/conferences\/cgiv2006\/ European Colour in \r\n% Graphics, Imaging, and Vision conference> today,\r\n% I took a tutorial called \"Transforms for Colour and Spectral\r\n% Reproduction.\" Mitch Rosen of the Munsell Color Science Laboratory, \r\n% Rochester Institute\r\n% of Technology, taught the class.\r\n%\r\n% Mitch's topics included how to solve inverse problems in order to \r\n% construct multidimensional lookup tables that transform colors from\r\n% one space to another.  One comment caught my ear - small approximation \r\n% errors in these lookup tables can be relatively worse for colors that are \r\n% neutral (gray) or near-neutral.\r\n%\r\n% Let's explore this idea using the L*a*b* color space.  L* is luminance,\r\n% while a* and b* represent red-green and yellow-blue color differences,\r\n% respectively.  Colors for which a* and b* equal zero are neutral, or gray.\r\n%\r\n% First let's look at a pair of reds that have the same luminance, and are\r\n% separated by a distance of 20 in the a*-b* plane.\r\n\r\nL = 85;\r\na = 70;\r\nb = 0;\r\n\r\nlab1 = [L a b];\r\nlab2 = [L a+20 b];\r\n\r\n%%\r\n% Now convert these colors to sRGB space and display each as a single-pixel\r\n% image.\r\n\r\ncform = makecform('lab2srgb');\r\nrgb1 = applycform(lab1, cform);\r\nrgb2 = applycform(lab2, cform);\r\n\r\nsubplot(1,2,1)\r\nimshow(reshape(rgb1,1,1,3))\r\ntitle('L*a*b* = [85 70 0]')\r\n\r\nsubplot(1,2,2)\r\nimshow(reshape(rgb2,1,1,3))\r\ntitle('L*a*b* = [85 90 0]')\r\n\r\nset(gcf, 'Color', 'w')\r\n\r\n%%\r\n% These colors are visibly different, but they have the same basic hue.\r\n%\r\n% Now let's try the same thing with colors that are the same distance\r\n% apart, but which are located close to the neutral axis.\r\n\r\nlab3 = [85 10 0];\r\nlab4 = [85 -10 0];\r\n\r\nrgb3 = applycform(lab3, cform);\r\nrgb4 = applycform(lab4, cform);\r\n\r\nsubplot(1,2,1)\r\nimshow(reshape(rgb3,1,1,3))\r\ntitle('L*a*b* = [85 10 0]')\r\n\r\nsubplot(1,2,2)\r\nimshow(reshape(rgb4,1,1,3))\r\ntitle('L*a*b* = [85 -10 0]')\r\n\r\nset(gcf, 'Color', 'w')\r\n\r\n%%\r\n% These colors have a distinctively different hue - one is pink and the\r\n% other is green.  The moral of the story is that \"small\" changes in a*-b*\r\n% are more likely to produce dramatic hue shifts for colors close to the\r\n% L*=0 axis.\r\n%\r\n% Conference quote of the day: \"In color science, if you want a real\r\n% controversy, start a terminology discussion.\" _- Jack Holm, \r\n% Hewlett-Packard_ \r\n##### SOURCE END ##### 65\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   At the European Colour in Graphics, Imaging, and Vision conference today, I took a tutorial called \"Transforms for Colour and Spectral Reproduction.\" Mitch Rosen of the Munsell Color Science\r\n  ... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/steve\/2006\/06\/19\/hue-shifts-near-the-l0-axis\/\">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":[114,172,36,112,170,72,52],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/65"}],"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=65"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":2191,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/65\/revisions\/2191"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}