<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do you get a colormap on a TIFF? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-do-you-get-a-colormap-on-a-tiff/m-p/1653713#M13703</link>
    <description>&lt;P&gt;I'm having a similar issue and have not found a solution. I wish Remap RasterFunction would be supported, without it, I see no viable solution. For example I have some rasters that hold negative values and so there is no way to apply any colormap to it, or remap the values to positive.&lt;/P&gt;</description>
    <pubDate>Sun, 28 Sep 2025 16:58:58 GMT</pubDate>
    <dc:creator>EmilisArc</dc:creator>
    <dc:date>2025-09-28T16:58:58Z</dc:date>
    <item>
      <title>How do you get a colormap on a TIFF?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-do-you-get-a-colormap-on-a-tiff/m-p/1653531#M13694</link>
      <description>&lt;P&gt;I have rasters that require a specific color per cell value. Here's a few of the scenarios&lt;/P&gt;&lt;P&gt;Scenario 1: I have a raster that represents true/false where cells are either 0 for true or 1 for false. In this case I can use the ColormapRenderer with 2 colors. This seems to correctly apply the color by assigning color index to value.&lt;/P&gt;&lt;P&gt;Scenario 2: I have a raster where cells have a non-linear int as its value. For example, cell values could be 1, 8, 22, 34 &amp;amp; 100. Lets say 1=red, 8=blue, 22=green, 34=black, &amp;amp; 100=white. There are no other cell values and there is never a no_data value in this sample. These numbers seem random, but they mean something to the analyst, so I cannot reduce them down to 0, 1, 2, 3, &amp;amp; 4 respectively. In this example, I tried using a ColormapRenderer with 5 colors, but only the cells with value 1 got a color and it would be my 2nd color in my list(again, based on index). I tried adding 101 colors to the renderer where I assign the correct color to index, i.e. colors[22] = green. I filled the rest of the colors list with Purple to make errors more visible. This resulted in most of the cells showing with their assigned colors, but there was a lot of purple mixed in. I do not know how to get this to work consistently with my data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ideal situation is a colormap with values similar to a unique value renderer. I just want to color my cells by value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was also looking into trying the Colormap RasterFunction (&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/layers/add-raster-data/#supported-raster-functions" target="_blank"&gt;Add raster data | ArcGIS Maps SDK for .NET | Esri Developer&lt;/A&gt; ), but I could not figure out the format for "color1" from the template shown below.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;{
  "raster_function":{"type":"Colormap_function"},
  "raster_function_arguments":
  {
    "raster_colormap":{"colors":[color1,color2,...,colorN],"type":"Raster_function_variable"},
    "raster":{"name":"raster","is_raster":true,"type":"Raster_function_variable"},
    "type":"Raster_function_arguments"
  },
  "type":"Raster_function_template"
}&lt;/LI-CODE&gt;&lt;P&gt;I've tried several different formats, but nothing seems to have any effect on the raster in my map. Here's the things I've tried:&lt;/P&gt;&lt;P&gt;1. RGB in an int array -&amp;gt; [200, 200, 200]&lt;/P&gt;&lt;P&gt;2. RGBA in an int array -&amp;gt; [200, 200, 200, 255]&lt;/P&gt;&lt;P&gt;3. Value + RGB -&amp;gt; [3, 200, 200, 200]&lt;/P&gt;&lt;P&gt;4. GPT recommended a structure like this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;"colors": [
  { "value": 0, "color": [0, 0, 0, 255] },       // Black
  { "value": 1, "color": [255, 0, 0, 255] },     // Red
  { "value": 2, "color": [0, 255, 0, 255] },     // Green
  { "value": 3, "color": [0, 0, 255, 255] }      // Blue
]&lt;/LI-CODE&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;The 3rd option using Value+RGB is what the RestAPI (&amp;nbsp;&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/raster-function-objects/#colormap" target="_blank"&gt;Raster function objects | ArcGIS REST APIs | Esri Developer&lt;/A&gt; ) shows in their samples, but I have never gotten any of the RestAPI raster functions to work in the Maps SDK, so I usually just use this for guidance/ideas rather than a 1:1. I have had success in the past with the structure from the "Add raster data" sample, so I assume this is the format that is expected.&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;I just do not know what it expects for &lt;SPAN&gt;[color1,color2,...,colorN]&lt;/SPAN&gt;:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice/tips/tricks would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2025 15:06:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-do-you-get-a-colormap-on-a-tiff/m-p/1653531#M13694</guid>
      <dc:creator>JBuchanan</dc:creator>
      <dc:date>2025-09-26T15:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get a colormap on a TIFF?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-do-you-get-a-colormap-on-a-tiff/m-p/1653713#M13703</link>
      <description>&lt;P&gt;I'm having a similar issue and have not found a solution. I wish Remap RasterFunction would be supported, without it, I see no viable solution. For example I have some rasters that hold negative values and so there is no way to apply any colormap to it, or remap the values to positive.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Sep 2025 16:58:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-do-you-get-a-colormap-on-a-tiff/m-p/1653713#M13703</guid>
      <dc:creator>EmilisArc</dc:creator>
      <dc:date>2025-09-28T16:58:58Z</dc:date>
    </item>
  </channel>
</rss>

