title: Compare 2 16x16 pixel images similarity
body: <p>I would like to compare 2 images similarity with percentage. I want to detect 90% same images. Each image size is 16x16 pixel. I need some clue, help about it. Right now i am able to detect 100% same images when comparing with the code below</p>
  
  <pre><code>for (; x &lt; irMainX; x++)
  {
  
      for (; y &lt; irMainY; y++)
      {
          Color pixelColor = image.GetPixel(x, y);
          if (pixelColor.A.ToString() != srClickedArray[x % 16, y % 16, 0])
          {
              blSame = false;
              y = 16;
              break;
          }
          if (pixelColor.R.ToString() != srClickedArray[x % 16, y % 16, 1])
          {
              blSame = false;
              y = 16;
              break;
          }
          if (pixelColor.G.ToString() != srClickedArray[x % 16, y % 16, 2])
          {
              blSame = false;
              y = 16;
              break;
          }
          if (pixelColor.B.ToString() != srClickedArray[x % 16, y % 16, 3])
          {
              blSame = false;
              y = 16;
              break;
          }
      }
  
      y = y - 16;
  
      if (blSame == false)
          break;
  }
  </code></pre>
  
  <p>For example i would like to recognize these 2 images as same. Currently the software recognizes them as different images since they are not exactly same</p>
  
  <p><img src="https://i.stack.imgur.com/i8vDb.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/MnEwL.png" alt="enter image description here"></p>