title: Why am i getting this error "'SetPixel is not supported for images with indexed pixel formats"
body: <p>I am trying to make threshold process on an image. The image of type "tif" and i am getting this error says</p>
  
  <blockquote>
    <p>SetPixel is not supported for images with indexed pixel formats</p>
  </blockquote>
  
  <p>This is my code and <code>p11</code> is the image name</p>
  
  <pre><code>for (int r = 0; r &lt; p11.Width; r++)
  {
      //  whiteColor = 0;
      //  blackColor = 0;
      for (int c = 0; c &lt; p11.Height; c++)
      {
          num1 = int.Parse(p11.GetPixel(r, c).A.ToString()); // gets the alpha component value of this colout
          num2 = int.Parse(p11.GetPixel(r, c).B.ToString()); // gets the Blue component value of this colout
          num3 = int.Parse(p11.GetPixel(r, c).R.ToString()); // gets the Red component value of this colout
          num4 = int.Parse(p11.GetPixel(r, c).G.ToString()); // gets the green component value of this colout
  
          if( T &lt;= num1 &amp;&amp; T &lt;= num2 &amp;&amp; T &lt;= num3 &amp;&amp; T &lt;= num4)
          {
  
          }
          else
          {
              p11.SetPixel(r, c, Color.Black);
          }
      }
  }
  </code></pre>