title: Getting Hue from every pixel in an Image
body: <p>I am trying to get the Hue or 'H' of every pixel of an image, then changing the colour of the pixel that has a specific Hue. I am trying to change all pixels that have a hue >= 210 and &lt;=260, which is the different hues of blue.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>// 'i' is the image
  // 'b' is the bitmap of the image
  float y;
  for (int a = 0; a &lt; i.Height; a++) 
  { 
      for (int c = 0; c &lt; i.Width; c++) 
      { 
          y = b.GetPixel(c, a).GetHue(); 
          if (y &gt;= 210 &amp;&amp; y &lt;= 260) 
              { 
                  b.SetPixel(c, a, Color.Black); 
              } 
      } 
  }
  </code></pre>
  
  <p>The only problem is that it doesn't pickup any blue colours, which are from 210 - 260. I am pretty sure that I am doing this correctly, but I must not be since it isnt working.</p>
  
  <p>Please post here if you can solve this problem, Thanks!</p>
  
  <p>Edit: I put a breakpoint on SetPixel, and it gets called many, many times so now I will check if I am saving the picture right.</p>
  
  <p>Edit 2: I figured it out! I wasn't saving the picture.</p>