{"id":605,"date":"2012-06-02T14:17:38","date_gmt":"2012-06-02T18:17:38","guid":{"rendered":"https:\/\/blogs.mathworks.com\/steve\/?p=605"},"modified":"2019-10-31T14:48:37","modified_gmt":"2019-10-31T18:48:37","slug":"making-an-html-table-of-pixel-values-with-colored-cells","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/steve\/2012\/06\/02\/making-an-html-table-of-pixel-values-with-colored-cells\/","title":{"rendered":"Making an HTML table of pixel values with colored cells"},"content":{"rendered":"<div class=\"content\"><p>Today's post shows you how to make a table with image colors and pixels appear when you publish your MATLAB scripts to HTML using the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2012a\/techdoc\/ref\/publish.html\"><tt>publish<\/tt><\/a> function. The result looks like this:<\/p><pre class=\"codeinput\">rgb = imread(<span class=\"string\">'peppers.png'<\/span>);\r\ndisp(im2html(rgb(88:92,200:204,:)))\r\n<\/pre>\r\n  <head>\r\n\r\n    <style>\r\n      .image-table {\r\n        border: thin solid black;\r\n        table-layout: fixed;\r\n      }\r\n\r\n      .light-pixel-cell {\r\n        font-size: small;\r\n        font-family: Consolas, 'Courier New', monospace;\r\n        border-style: solid;\r\n        border-width: thin;\r\n        border-color: black;\r\n        padding: 1;\r\n        height: 4.5em;\r\n        width: 4.5em;\r\n        text-align: center;\r\n        color: black;\r\n      }\r\n\r\n      .dark-pixel-cell {\r\n        font-size: small;\r\n        font-family: Consolas, 'Courier New', monospace;\r\n        border-style: solid;\r\n        border-width: thin;\r\n        border-color: black;\r\n        padding: 1;\r\n        height: 4.5em;\r\n        width: 4.5em;\r\n        text-align: center;\r\n        color: white;\r\n      }\r\n\r\n    <\/style>\r\n\r\n  <\/head>\r\n  <body>\r\n    <table class=\"image-table\">\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 1  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#50324D; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:80<br \\>G:50<br \\>B:77\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#4E2F4A; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:78<br \\>G:47<br \\>B:74\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 3 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#4C2F47; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:76<br \\>G:47<br \\>B:71\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 4 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#5F4149; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:95<br \\>G:65<br \\>B:73\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9E8175; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:158<br \\>G:129<br \\>B:117\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 2  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#4C2F4D; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:76<br \\>G:47<br \\>B:77\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#4B2E47; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:75<br \\>G:46<br \\>B:71\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 3 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#5B3F48; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:91<br \\>G:63<br \\>B:72\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9E8277; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:158<br \\>G:130<br \\>B:119\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#C0A58D; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:192<br \\>G:165<br \\>B:141\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 3  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#4D2D46; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:77<br \\>G:45<br \\>B:70\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#52333F; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:82<br \\>G:51<br \\>B:63\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#947872; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:148<br \\>G:120<br \\>B:114\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#C0A692; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:192<br \\>G:166<br \\>B:146\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#CBB099; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:203<br \\>G:176<br \\>B:153\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 4  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#4B2B41; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:75<br \\>G:43<br \\>B:65\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#7E5F61; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:126<br \\>G:&nbsp;95<br \\>B:&nbsp;97\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#BAA091; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:186<br \\>G:160<br \\>B:145\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#C5AD9A; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:197<br \\>G:173<br \\>B:154\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#D0B4A0; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:208<br \\>G:180<br \\>B:160\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 5  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#644648; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:100<br \\>G:&nbsp;70<br \\>B:&nbsp;72\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#AE9287; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:174<br \\>G:146<br \\>B:135\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#C1A997; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:193<br \\>G:169<br \\>B:151\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#C6AF9E; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:198<br \\>G:175<br \\>B:158\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#D3BDAA; width:5.0em; height:5.0em; padding:1px;\">\r\n          R:211<br \\>G:189<br \\>B:170\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n    <\/table>\r\n  <\/body>\r\n<p>I was inspired to do something like this when I saw <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/14453-printing-variables-to-html-tables-in-published-code\"><i>Printing Variables to HTML Tables in Published Code<\/i><\/a> (by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/3050\">Ned<\/a>) on the File Exchange a while back. It also produces an HTML table with colored cells and superimposed values.  <\/p><p>I was also thinking about the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2012a\/toolbox\/images\/ref\/impixelregion.html\">Pixel Region Tool<\/a> in the Image Processing Toolbox. Here's a screen shot:<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2012\/pixel-region-screen-shot.png\" alt=\"\"> <\/p><p>I wanted to go a bit further than Ned's original. I wanted to handle all the different kinds of image types (grayscale, truecolor, indexed with direct mapping, indexed with scaled mapping). I also wanted to replicate the feature of the Pixel Region Tool that automatically changed the color of the superimposed text depending on whether the underlying pixel was dark or light. (You can see that effect in the screen shot above.)<\/p><p>I've packaged all this in a function called <tt>im2html<\/tt>. You can <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/32273-im2html-m\">download<\/a> this function from the File Exchange.<\/p><p>Here are some examples showing how to use <tt>im2html<\/tt> with different types of images.<\/p><p>Display a table of values for a gray-scale image:<\/p><pre class=\"codeinput\">I = imread(<span class=\"string\">'pout.tif'<\/span>);\r\ndisp(im2html(I(125:134, 104:114)))\r\n<\/pre>\r\n  <head>\r\n\r\n    <style>\r\n      .image-table {\r\n        border: thin solid black;\r\n        table-layout: fixed;\r\n      }\r\n\r\n      .light-pixel-cell {\r\n        font-size: small;\r\n        font-family: Consolas, 'Courier New', monospace;\r\n        border-style: solid;\r\n        border-width: thin;\r\n        border-color: black;\r\n        padding: 1;\r\n        height: 4.5em;\r\n        width: 4.5em;\r\n        text-align: center;\r\n        color: black;\r\n      }\r\n\r\n      .dark-pixel-cell {\r\n        font-size: small;\r\n        font-family: Consolas, 'Courier New', monospace;\r\n        border-style: solid;\r\n        border-width: thin;\r\n        border-color: black;\r\n        padding: 1;\r\n        height: 4.5em;\r\n        width: 4.5em;\r\n        text-align: center;\r\n        color: white;\r\n      }\r\n\r\n    <\/style>\r\n\r\n  <\/head>\r\n  <body>\r\n    <table class=\"image-table\">\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 1  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#707070; width:3.0em; height:3.0em; padding:1px;\">\r\n          112\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#707070; width:3.0em; height:3.0em; padding:1px;\">\r\n          112\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 3 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6B6B6B; width:3.0em; height:3.0em; padding:1px;\">\r\n          107\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 4 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#616161; width:3.0em; height:3.0em; padding:1px;\">\r\n          97\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 5 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#5B5B5B; width:3.0em; height:3.0em; padding:1px;\">\r\n          91\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 6 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#575757; width:3.0em; height:3.0em; padding:1px;\">\r\n          87\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 7 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#565656; width:3.0em; height:3.0em; padding:1px;\">\r\n          86\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 8 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#545454; width:3.0em; height:3.0em; padding:1px;\">\r\n          84\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 9 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#535353; width:3.0em; height:3.0em; padding:1px;\">\r\n          83\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 10 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#545454; width:3.0em; height:3.0em; padding:1px;\">\r\n          84\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 11 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#545454; width:3.0em; height:3.0em; padding:1px;\">\r\n          84\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 2  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#787878; width:3.0em; height:3.0em; padding:1px;\">\r\n          120\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#7E7E7E; width:3.0em; height:3.0em; padding:1px;\">\r\n          126\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#808080; width:3.0em; height:3.0em; padding:1px;\">\r\n          128\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#808080; width:3.0em; height:3.0em; padding:1px;\">\r\n          128\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 5 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#727272; width:3.0em; height:3.0em; padding:1px;\">\r\n          114\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 6 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#656565; width:3.0em; height:3.0em; padding:1px;\">\r\n          101\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 7 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#575757; width:3.0em; height:3.0em; padding:1px;\">\r\n          87\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 8 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#575757; width:3.0em; height:3.0em; padding:1px;\">\r\n          87\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 9 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#565656; width:3.0em; height:3.0em; padding:1px;\">\r\n          86\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 10 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#565656; width:3.0em; height:3.0em; padding:1px;\">\r\n          86\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 11 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#575757; width:3.0em; height:3.0em; padding:1px;\">\r\n          87\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 3  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#747474; width:3.0em; height:3.0em; padding:1px;\">\r\n          116\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#848484; width:3.0em; height:3.0em; padding:1px;\">\r\n          132\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#8A8A8A; width:3.0em; height:3.0em; padding:1px;\">\r\n          138\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#8E8E8E; width:3.0em; height:3.0em; padding:1px;\">\r\n          142\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#8E8E8E; width:3.0em; height:3.0em; padding:1px;\">\r\n          142\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#848484; width:3.0em; height:3.0em; padding:1px;\">\r\n          132\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 7 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#626262; width:3.0em; height:3.0em; padding:1px;\">\r\n          98\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 8 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#5B5B5B; width:3.0em; height:3.0em; padding:1px;\">\r\n          91\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 9 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#595959; width:3.0em; height:3.0em; padding:1px;\">\r\n          89\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 10 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#575757; width:3.0em; height:3.0em; padding:1px;\">\r\n          87\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 11 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#595959; width:3.0em; height:3.0em; padding:1px;\">\r\n          89\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 4  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6E6E6E; width:3.0em; height:3.0em; padding:1px;\">\r\n          110\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#858585; width:3.0em; height:3.0em; padding:1px;\">\r\n          133\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#919191; width:3.0em; height:3.0em; padding:1px;\">\r\n          145\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#969696; width:3.0em; height:3.0em; padding:1px;\">\r\n          150\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#959595; width:3.0em; height:3.0em; padding:1px;\">\r\n          149\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#939393; width:3.0em; height:3.0em; padding:1px;\">\r\n          147\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 7 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#797979; width:3.0em; height:3.0em; padding:1px;\">\r\n          121\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 8 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#656565; width:3.0em; height:3.0em; padding:1px;\">\r\n          101\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 9 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#5D5D5D; width:3.0em; height:3.0em; padding:1px;\">\r\n          93\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 10 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#5D5D5D; width:3.0em; height:3.0em; padding:1px;\">\r\n          93\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 11 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#5B5B5B; width:3.0em; height:3.0em; padding:1px;\">\r\n          91\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 5  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6D6D6D; width:3.0em; height:3.0em; padding:1px;\">\r\n          109\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#858585; width:3.0em; height:3.0em; padding:1px;\">\r\n          133\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#919191; width:3.0em; height:3.0em; padding:1px;\">\r\n          145\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9C9C9C; width:3.0em; height:3.0em; padding:1px;\">\r\n          156\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9F9F9F; width:3.0em; height:3.0em; padding:1px;\">\r\n          159\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#999999; width:3.0em; height:3.0em; padding:1px;\">\r\n          153\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 7 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#8E8E8E; width:3.0em; height:3.0em; padding:1px;\">\r\n          142\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 8 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#828282; width:3.0em; height:3.0em; padding:1px;\">\r\n          130\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 9 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6D6D6D; width:3.0em; height:3.0em; padding:1px;\">\r\n          109\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 10 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#666666; width:3.0em; height:3.0em; padding:1px;\">\r\n          102\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 11 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#636363; width:3.0em; height:3.0em; padding:1px;\">\r\n          99\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 6  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6D6D6D; width:3.0em; height:3.0em; padding:1px;\">\r\n          109\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#838383; width:3.0em; height:3.0em; padding:1px;\">\r\n          131\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#8F8F8F; width:3.0em; height:3.0em; padding:1px;\">\r\n          143\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9A9A9A; width:3.0em; height:3.0em; padding:1px;\">\r\n          154\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#A9A9A9; width:3.0em; height:3.0em; padding:1px;\">\r\n          169\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#ABABAB; width:3.0em; height:3.0em; padding:1px;\">\r\n          171\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 7 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#A9A9A9; width:3.0em; height:3.0em; padding:1px;\">\r\n          169\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 8 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#A9A9A9; width:3.0em; height:3.0em; padding:1px;\">\r\n          169\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 9 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9A9A9A; width:3.0em; height:3.0em; padding:1px;\">\r\n          154\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 10 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#8B8B8B; width:3.0em; height:3.0em; padding:1px;\">\r\n          139\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 11 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#898989; width:3.0em; height:3.0em; padding:1px;\">\r\n          137\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 7  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6C6C6C; width:3.0em; height:3.0em; padding:1px;\">\r\n          108\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#7E7E7E; width:3.0em; height:3.0em; padding:1px;\">\r\n          126\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#8E8E8E; width:3.0em; height:3.0em; padding:1px;\">\r\n          142\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#979797; width:3.0em; height:3.0em; padding:1px;\">\r\n          151\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#A9A9A9; width:3.0em; height:3.0em; padding:1px;\">\r\n          169\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#AFAFAF; width:3.0em; height:3.0em; padding:1px;\">\r\n          175\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 7 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#BABABA; width:3.0em; height:3.0em; padding:1px;\">\r\n          186\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 8 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#BEBEBE; width:3.0em; height:3.0em; padding:1px;\">\r\n          190\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 9 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#BDBDBD; width:3.0em; height:3.0em; padding:1px;\">\r\n          189\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 10 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#B4B4B4; width:3.0em; height:3.0em; padding:1px;\">\r\n          180\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 11 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#B3B3B3; width:3.0em; height:3.0em; padding:1px;\">\r\n          179\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 8  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6E6E6E; width:3.0em; height:3.0em; padding:1px;\">\r\n          110\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#797979; width:3.0em; height:3.0em; padding:1px;\">\r\n          121\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#898989; width:3.0em; height:3.0em; padding:1px;\">\r\n          137\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#949494; width:3.0em; height:3.0em; padding:1px;\">\r\n          148\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9E9E9E; width:3.0em; height:3.0em; padding:1px;\">\r\n          158\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#A7A7A7; width:3.0em; height:3.0em; padding:1px;\">\r\n          167\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 7 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#B1B1B1; width:3.0em; height:3.0em; padding:1px;\">\r\n          177\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 8 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#BBBBBB; width:3.0em; height:3.0em; padding:1px;\">\r\n          187\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 9 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#C7C7C7; width:3.0em; height:3.0em; padding:1px;\">\r\n          199\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 10 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#BDBDBD; width:3.0em; height:3.0em; padding:1px;\">\r\n          189\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 11 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#B9B9B9; width:3.0em; height:3.0em; padding:1px;\">\r\n          185\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 9  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#707070; width:3.0em; height:3.0em; padding:1px;\">\r\n          112\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#757575; width:3.0em; height:3.0em; padding:1px;\">\r\n          117\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#888888; width:3.0em; height:3.0em; padding:1px;\">\r\n          136\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#929292; width:3.0em; height:3.0em; padding:1px;\">\r\n          146\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#979797; width:3.0em; height:3.0em; padding:1px;\">\r\n          151\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9F9F9F; width:3.0em; height:3.0em; padding:1px;\">\r\n          159\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 7 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9F9F9F; width:3.0em; height:3.0em; padding:1px;\">\r\n          159\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 8 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#A3A3A3; width:3.0em; height:3.0em; padding:1px;\">\r\n          163\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 9 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#BDBDBD; width:3.0em; height:3.0em; padding:1px;\">\r\n          189\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 10 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#BDBDBD; width:3.0em; height:3.0em; padding:1px;\">\r\n          189\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 11 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#B4B4B4; width:3.0em; height:3.0em; padding:1px;\">\r\n          180\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 10  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#727272; width:3.0em; height:3.0em; padding:1px;\">\r\n          114\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#717171; width:3.0em; height:3.0em; padding:1px;\">\r\n          113\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#848484; width:3.0em; height:3.0em; padding:1px;\">\r\n          132\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#8E8E8E; width:3.0em; height:3.0em; padding:1px;\">\r\n          142\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#939393; width:3.0em; height:3.0em; padding:1px;\">\r\n          147\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#979797; width:3.0em; height:3.0em; padding:1px;\">\r\n          151\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 7 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9C9C9C; width:3.0em; height:3.0em; padding:1px;\">\r\n          156\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 8 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9A9A9A; width:3.0em; height:3.0em; padding:1px;\">\r\n          154\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 9 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#A2A2A2; width:3.0em; height:3.0em; padding:1px;\">\r\n          162\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 10 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#B8B8B8; width:3.0em; height:3.0em; padding:1px;\">\r\n          184\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 11 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#B3B3B3; width:3.0em; height:3.0em; padding:1px;\">\r\n          179\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n    <\/table>\r\n  <\/body>\r\n<pre class=\"codeinput\">I = magic(10);\r\ndisp(im2html(I,[]))\r\n<\/pre>\r\n  <head>\r\n\r\n    <style>\r\n      .image-table {\r\n        border: thin solid black;\r\n        table-layout: fixed;\r\n      }\r\n\r\n      .light-pixel-cell {\r\n        font-size: small;\r\n        font-family: Consolas, 'Courier New', monospace;\r\n        border-style: solid;\r\n        border-width: thin;\r\n        border-color: black;\r\n        padding: 1;\r\n        height: 4.5em;\r\n        width: 4.5em;\r\n        text-align: center;\r\n        color: black;\r\n      }\r\n\r\n      .dark-pixel-cell {\r\n        font-size: small;\r\n        font-family: Consolas, 'Courier New', monospace;\r\n        border-style: solid;\r\n        border-width: thin;\r\n        border-color: black;\r\n        padding: 1;\r\n        height: 4.5em;\r\n        width: 4.5em;\r\n        text-align: center;\r\n        color: white;\r\n      }\r\n\r\n    <\/style>\r\n\r\n  <\/head>\r\n  <body>\r\n    <table class=\"image-table\">\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 1  COL: 1 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#EAEAEA; width:3.0em; height:3.0em; padding:1px;\">\r\n          92\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#FCFCFC; width:3.0em; height:3.0em; padding:1px;\">\r\n          99\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 3 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#000000; width:3.0em; height:3.0em; padding:1px;\">\r\n          1\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 4 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#121212; width:3.0em; height:3.0em; padding:1px;\">\r\n          8\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 5 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#242424; width:3.0em; height:3.0em; padding:1px;\">\r\n          15\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#AAAAAA; width:3.0em; height:3.0em; padding:1px;\">\r\n          67\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 7 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#BCBCBC; width:3.0em; height:3.0em; padding:1px;\">\r\n          74\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 8 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#818181; width:3.0em; height:3.0em; padding:1px;\">\r\n          51\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 9 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#939393; width:3.0em; height:3.0em; padding:1px;\">\r\n          58\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 10 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#646464; width:3.0em; height:3.0em; padding:1px;\">\r\n          40\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 2  COL: 1 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#FAFAFA; width:3.0em; height:3.0em; padding:1px;\">\r\n          98\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#CBCBCB; width:3.0em; height:3.0em; padding:1px;\">\r\n          80\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 3 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#0F0F0F; width:3.0em; height:3.0em; padding:1px;\">\r\n          7\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 4 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#212121; width:3.0em; height:3.0em; padding:1px;\">\r\n          14\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 5 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#272727; width:3.0em; height:3.0em; padding:1px;\">\r\n          16\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#B9B9B9; width:3.0em; height:3.0em; padding:1px;\">\r\n          73\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 7 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#8B8B8B; width:3.0em; height:3.0em; padding:1px;\">\r\n          55\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 8 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#909090; width:3.0em; height:3.0em; padding:1px;\">\r\n          57\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 9 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#A2A2A2; width:3.0em; height:3.0em; padding:1px;\">\r\n          64\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 10 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#676767; width:3.0em; height:3.0em; padding:1px;\">\r\n          41\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 3  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#080808; width:3.0em; height:3.0em; padding:1px;\">\r\n          4\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#CECECE; width:3.0em; height:3.0em; padding:1px;\">\r\n          81\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#E0E0E0; width:3.0em; height:3.0em; padding:1px;\">\r\n          88\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 4 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#313131; width:3.0em; height:3.0em; padding:1px;\">\r\n          20\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 5 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#363636; width:3.0em; height:3.0em; padding:1px;\">\r\n          22\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#898989; width:3.0em; height:3.0em; padding:1px;\">\r\n          54\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 7 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#8E8E8E; width:3.0em; height:3.0em; padding:1px;\">\r\n          56\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 8 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#A0A0A0; width:3.0em; height:3.0em; padding:1px;\">\r\n          63\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 9 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#B2B2B2; width:3.0em; height:3.0em; padding:1px;\">\r\n          70\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 10 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#767676; width:3.0em; height:3.0em; padding:1px;\">\r\n          47\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 4  COL: 1 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#D8D8D8; width:3.0em; height:3.0em; padding:1px;\">\r\n          85\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#DEDEDE; width:3.0em; height:3.0em; padding:1px;\">\r\n          87\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 3 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#2E2E2E; width:3.0em; height:3.0em; padding:1px;\">\r\n          19\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 4 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#343434; width:3.0em; height:3.0em; padding:1px;\">\r\n          21\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 5 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#050505; width:3.0em; height:3.0em; padding:1px;\">\r\n          3\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#989898; width:3.0em; height:3.0em; padding:1px;\">\r\n          60\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 7 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9D9D9D; width:3.0em; height:3.0em; padding:1px;\">\r\n          62\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 8 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#AFAFAF; width:3.0em; height:3.0em; padding:1px;\">\r\n          69\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 9 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#B4B4B4; width:3.0em; height:3.0em; padding:1px;\">\r\n          71\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 10 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#464646; width:3.0em; height:3.0em; padding:1px;\">\r\n          28\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 5  COL: 1 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#DBDBDB; width:3.0em; height:3.0em; padding:1px;\">\r\n          86\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#EDEDED; width:3.0em; height:3.0em; padding:1px;\">\r\n          93\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 3 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#3E3E3E; width:3.0em; height:3.0em; padding:1px;\">\r\n          25\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 4 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#030303; width:3.0em; height:3.0em; padding:1px;\">\r\n          2\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 5 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#151515; width:3.0em; height:3.0em; padding:1px;\">\r\n          9\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 6 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#9B9B9B; width:3.0em; height:3.0em; padding:1px;\">\r\n          61\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 7 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#ADADAD; width:3.0em; height:3.0em; padding:1px;\">\r\n          68\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 8 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#BFBFBF; width:3.0em; height:3.0em; padding:1px;\">\r\n          75\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 9 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#838383; width:3.0em; height:3.0em; padding:1px;\">\r\n          52\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 10 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#555555; width:3.0em; height:3.0em; padding:1px;\">\r\n          34\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 6  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#292929; width:3.0em; height:3.0em; padding:1px;\">\r\n          17\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#3B3B3B; width:3.0em; height:3.0em; padding:1px;\">\r\n          24\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#C1C1C1; width:3.0em; height:3.0em; padding:1px;\">\r\n          76\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#D3D3D3; width:3.0em; height:3.0em; padding:1px;\">\r\n          83\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#E5E5E5; width:3.0em; height:3.0em; padding:1px;\">\r\n          90\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 6 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6A6A6A; width:3.0em; height:3.0em; padding:1px;\">\r\n          42\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 7 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#7C7C7C; width:3.0em; height:3.0em; padding:1px;\">\r\n          49\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 8 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#404040; width:3.0em; height:3.0em; padding:1px;\">\r\n          26\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 9 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#525252; width:3.0em; height:3.0em; padding:1px;\">\r\n          33\r\n        <\/td>\r\n\r\n        <!-- ROW: 6  COL: 10 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#A5A5A5; width:3.0em; height:3.0em; padding:1px;\">\r\n          65\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 7  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#393939; width:3.0em; height:3.0em; padding:1px;\">\r\n          23\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#0A0A0A; width:3.0em; height:3.0em; padding:1px;\">\r\n          5\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#D1D1D1; width:3.0em; height:3.0em; padding:1px;\">\r\n          82\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#E3E3E3; width:3.0em; height:3.0em; padding:1px;\">\r\n          89\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#E8E8E8; width:3.0em; height:3.0em; padding:1px;\">\r\n          91\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 6 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#797979; width:3.0em; height:3.0em; padding:1px;\">\r\n          48\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 7 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#4B4B4B; width:3.0em; height:3.0em; padding:1px;\">\r\n          30\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 8 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#505050; width:3.0em; height:3.0em; padding:1px;\">\r\n          32\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 9 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#626262; width:3.0em; height:3.0em; padding:1px;\">\r\n          39\r\n        <\/td>\r\n\r\n        <!-- ROW: 7  COL: 10 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#A7A7A7; width:3.0em; height:3.0em; padding:1px;\">\r\n          66\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 8  COL: 1 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#C9C9C9; width:3.0em; height:3.0em; padding:1px;\">\r\n          79\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#0D0D0D; width:3.0em; height:3.0em; padding:1px;\">\r\n          6\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 3 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#1F1F1F; width:3.0em; height:3.0em; padding:1px;\">\r\n          13\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#F2F2F2; width:3.0em; height:3.0em; padding:1px;\">\r\n          95\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#F7F7F7; width:3.0em; height:3.0em; padding:1px;\">\r\n          97\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 6 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#484848; width:3.0em; height:3.0em; padding:1px;\">\r\n          29\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 7 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#4D4D4D; width:3.0em; height:3.0em; padding:1px;\">\r\n          31\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 8 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#5F5F5F; width:3.0em; height:3.0em; padding:1px;\">\r\n          38\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 9 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#717171; width:3.0em; height:3.0em; padding:1px;\">\r\n          45\r\n        <\/td>\r\n\r\n        <!-- ROW: 8  COL: 10 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#B7B7B7; width:3.0em; height:3.0em; padding:1px;\">\r\n          72\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 9  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#171717; width:3.0em; height:3.0em; padding:1px;\">\r\n          10\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#1C1C1C; width:3.0em; height:3.0em; padding:1px;\">\r\n          12\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#F0F0F0; width:3.0em; height:3.0em; padding:1px;\">\r\n          94\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#F5F5F5; width:3.0em; height:3.0em; padding:1px;\">\r\n          96\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#C6C6C6; width:3.0em; height:3.0em; padding:1px;\">\r\n          78\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 6 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#585858; width:3.0em; height:3.0em; padding:1px;\">\r\n          35\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 7 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#5D5D5D; width:3.0em; height:3.0em; padding:1px;\">\r\n          37\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 8 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6F6F6F; width:3.0em; height:3.0em; padding:1px;\">\r\n          44\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 9 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#747474; width:3.0em; height:3.0em; padding:1px;\">\r\n          46\r\n        <\/td>\r\n\r\n        <!-- ROW: 9  COL: 10 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#868686; width:3.0em; height:3.0em; padding:1px;\">\r\n          53\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 10  COL: 1 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#1A1A1A; width:3.0em; height:3.0em; padding:1px;\">\r\n          11\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#2C2C2C; width:3.0em; height:3.0em; padding:1px;\">\r\n          18\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#FFFFFF; width:3.0em; height:3.0em; padding:1px;\">\r\n          100\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#C4C4C4; width:3.0em; height:3.0em; padding:1px;\">\r\n          77\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#D6D6D6; width:3.0em; height:3.0em; padding:1px;\">\r\n          84\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 6 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#5A5A5A; width:3.0em; height:3.0em; padding:1px;\">\r\n          36\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 7 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6C6C6C; width:3.0em; height:3.0em; padding:1px;\">\r\n          43\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 8 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#7E7E7E; width:3.0em; height:3.0em; padding:1px;\">\r\n          50\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 9 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#434343; width:3.0em; height:3.0em; padding:1px;\">\r\n          27\r\n        <\/td>\r\n\r\n        <!-- ROW: 10  COL: 10 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#959595; width:3.0em; height:3.0em; padding:1px;\">\r\n          59\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n    <\/table>\r\n  <\/body>\r\n<p>Display a table of values from an indexed image:<\/p><pre class=\"codeinput\">[X,map] = imread(<span class=\"string\">'trees.tif'<\/span>);\r\ndisp(im2html(X(156:160,244:248),map))\r\n<\/pre>\r\n  <head>\r\n\r\n    <style>\r\n      .image-table {\r\n        border: thin solid black;\r\n        table-layout: fixed;\r\n      }\r\n\r\n      .light-pixel-cell {\r\n        font-size: small;\r\n        font-family: Consolas, 'Courier New', monospace;\r\n        border-style: solid;\r\n        border-width: thin;\r\n        border-color: black;\r\n        padding: 1;\r\n        height: 4.5em;\r\n        width: 4.5em;\r\n        text-align: center;\r\n        color: black;\r\n      }\r\n\r\n      .dark-pixel-cell {\r\n        font-size: small;\r\n        font-family: Consolas, 'Courier New', monospace;\r\n        border-style: solid;\r\n        border-width: thin;\r\n        border-color: black;\r\n        padding: 1;\r\n        height: 4.5em;\r\n        width: 4.5em;\r\n        text-align: center;\r\n        color: white;\r\n      }\r\n\r\n    <\/style>\r\n\r\n  <\/head>\r\n  <body>\r\n    <table class=\"image-table\">\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 1  COL: 1 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#6BADDE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;93><br \\>R:0.42<br \\>G:0.68<br \\>B:0.87\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#6BADDE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;93><br \\>R:0.42<br \\>G:0.68<br \\>B:0.87\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#5AA5CE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;82><br \\>R:0.35<br \\>G:0.65<br \\>B:0.81\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#639CCE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;77><br \\>R:0.39<br \\>G:0.61<br \\>B:0.81\r\n        <\/td>\r\n\r\n        <!-- ROW: 1  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#6BADDE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;93><br \\>R:0.42<br \\>G:0.68<br \\>B:0.87\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 2  COL: 1 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#5AA5CE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;82><br \\>R:0.35<br \\>G:0.65<br \\>B:0.81\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#3973AD; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;45><br \\>R:0.22<br \\>G:0.45<br \\>B:0.68\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 3 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6B6B84; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;50><br \\>R:0.42<br \\>G:0.42<br \\>B:0.52\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 4 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#5AA5CE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;82><br \\>R:0.35<br \\>G:0.65<br \\>B:0.81\r\n        <\/td>\r\n\r\n        <!-- ROW: 2  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#5AA5CE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;82><br \\>R:0.35<br \\>G:0.65<br \\>B:0.81\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 3  COL: 1 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#6BADDE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;93><br \\>R:0.42<br \\>G:0.68<br \\>B:0.87\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 2 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#6B6B84; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;50><br \\>R:0.42<br \\>G:0.42<br \\>B:0.52\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 3 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#634A8C; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;32><br \\>R:0.39<br \\>G:0.29<br \\>B:0.55\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 4 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#845284; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;44><br \\>R:0.52<br \\>G:0.32<br \\>B:0.52\r\n        <\/td>\r\n\r\n        <!-- ROW: 3  COL: 5 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#6BADDE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;93><br \\>R:0.42<br \\>G:0.68<br \\>B:0.87\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 4  COL: 1 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#6BADDE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;93><br \\>R:0.42<br \\>G:0.68<br \\>B:0.87\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#6BADDE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;93><br \\>R:0.42<br \\>G:0.68<br \\>B:0.87\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 3 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#845284; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;44><br \\>R:0.52<br \\>G:0.32<br \\>B:0.52\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 4 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#94214A; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;20><br \\>R:0.58<br \\>G:0.13<br \\>B:0.29\r\n        <\/td>\r\n\r\n        <!-- ROW: 4  COL: 5 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#73396B; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;27><br \\>R:0.45<br \\>G:0.22<br \\>B:0.42\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n      <tr class=\"image-table-row\">\r\n        <!-- ROW: 5  COL: 1 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#8CBDE7; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;105><br \\>R:0.55<br \\>G:0.74<br \\>B:0.91\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 2 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#6BADDE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;93><br \\>R:0.42<br \\>G:0.68<br \\>B:0.87\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 3 -->\r\n        <td class=\"light-pixel-cell\" style=\"background-color:#639CCE; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;77><br \\>R:0.39<br \\>G:0.61<br \\>B:0.81\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 4 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#845284; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;44><br \\>R:0.52<br \\>G:0.32<br \\>B:0.52\r\n        <\/td>\r\n\r\n        <!-- ROW: 5  COL: 5 -->\r\n        <td class=\"dark-pixel-cell\" style=\"background-color:#94214A; width:6.0em; height:6.0em; padding:1px;\">\r\n          &lt;20><br \\>R:0.58<br \\>G:0.13<br \\>B:0.29\r\n        <\/td>\r\n\r\n      <\/tr>\r\n\r\n    <\/table>\r\n  <\/body>\r\n<p>You can also capture the output of <tt>im2html<\/tt> as a string, or write it directly to a file.<\/p><pre class=\"language-matlab\">s = im2html(magic(10),[]);\r\n<\/pre><pre class=\"language-matlab\">im2html(magic(10),[],<span class=\"string\">'OutputFile'<\/span>,<span class=\"string\">'magic_table.html'<\/span>)\r\n<\/pre><p>Give <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/32273-im2html-m\"><tt>im2html<\/tt><\/a> a try. Comment here (or on the <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/32273-im2html-m\">File Exchange page<\/a>) if you find a good use for it, or if you have ideas about making it better.<\/p><p>Next time I'll go into some of the details about how <tt>im2html<\/tt> works, including the use of raw HTML in your publishable MATLAB scripts, as well as an obscure thing in the Image Processing Toolbox called <tt>imagemodel<\/tt>.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_1ba6dda0bf304073ba1e85ce5485b986() {\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='1ba6dda0bf304073ba1e85ce5485b986 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 1ba6dda0bf304073ba1e85ce5485b986';\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        copyright = 'Copyright 2012 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 copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\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     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_1ba6dda0bf304073ba1e85ce5485b986()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.14<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; 7.14<br><\/p><\/div><!--\r\n1ba6dda0bf304073ba1e85ce5485b986 ##### SOURCE BEGIN #####\r\n%%\r\n% Today's post shows you how to make a table with image colors and pixels\r\n% appear when you publish your MATLAB scripts to HTML using the\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2012a\/techdoc\/ref\/publish.html |publish|>\r\n% function. The result looks like this:\r\n\r\nrgb = imread('peppers.png');\r\ndisp(im2html(rgb(88:92,200:204,:)))\r\n\r\n%%\r\n% I was inspired to do something like this when I saw\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/14453-printing-variables-to-html-tables-in-published-code\r\n% _Printing Variables to HTML Tables in Published Code_> (by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/3050 Ned>)\r\n% on the File Exchange a while back. It also produces an HTML table with\r\n% colored cells and superimposed values. Here's a sample:\r\n%\r\n% <<https:\/\/www.mathworks.com\/matlabcentral\/fx_files\/14453\/4\/htmlTables.png>>\r\n%\r\n% I was also thinking about the\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2012a\/toolbox\/images\/ref\/impixelregion.html\r\n% Pixel Region Tool> in the Image Processing Toolbox. Here's a screen shot:\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2012\/pixel-region-screen-shot.png>>\r\n%\r\n% I wanted to go a bit further than Ned's original. I wanted to handle all\r\n% the different kinds of image types (grayscale, truecolor, indexed with\r\n% direct mapping, indexed with scaled mapping). I also wanted to replicate\r\n% the feature of the Pixel Region Tool that automatically changed the color\r\n% of the superimposed text depending on whether the underlying pixel was\r\n% dark or light. (You can see that effect in the screen shot above.)\r\n%\r\n% I've packaged all this in a function called |im2html|. You can\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/32273-im2html-m\r\n% download> this function from the File Exchange.\r\n%\r\n% Here are some examples showing how to use |im2html| with different types\r\n% of images.\r\n%\r\n% Display a table of values for a gray-scale image:\r\n\r\nI = imread('pout.tif');\r\ndisp(im2html(I(125:134, 104:114)))\r\n\r\n%%\r\n\r\nI = magic(10);\r\ndisp(im2html(I,[]))\r\n\r\n%%\r\n% Display a table of values from an indexed image:\r\n\r\n[X,map] = imread('trees.tif');\r\ndisp(im2html(X(156:160,244:248),map))\r\n\r\n%%\r\n% You can also capture the output of |im2html| as a string, or write it\r\n% directly to a file.\r\n%\r\n%   s = im2html(magic(10),[]);\r\n%\r\n%   im2html(magic(10),[],'OutputFile','magic_table.html')\r\n%\r\n% Give <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/32273-im2html-m\r\n% |im2html|> a try. Comment here (or on the\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/32273-im2html-m File\r\n% Exchange page>) if you find a good use for it, or if you have ideas about\r\n% making it better.\r\n%\r\n% Next time I'll go into some of the details about how |im2html| works,\r\n% including the use of raw HTML in your publishable MATLAB scripts, as well\r\n% as an obscure thing in the Image Processing Toolbox called |imagemodel|.\r\n##### SOURCE END ##### 1ba6dda0bf304073ba1e85ce5485b986\r\n-->","protected":false},"excerpt":{"rendered":"<p>Today's post shows you how to make a table with image colors and pixels appear when you publish your MATLAB scripts to HTML using the publish function. The result looks like this:rgb =... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/steve\/2012\/06\/02\/making-an-html-table-of-pixel-values-with-colored-cells\/\">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":[899,76,54],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/605"}],"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=605"}],"version-history":[{"count":10,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/605\/revisions"}],"predecessor-version":[{"id":2463,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/605\/revisions\/2463"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/media?parent=605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/categories?post=605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/tags?post=605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}