title: Checking if two images with noise are similar using Pillow
body: <p>I have a dataset of images that are similar but not pixel by pixel perfect. I am trying to write a function to determine if two are similar or not using the following code below from the Pillow library. How can I de-noise an image then properly compare with a threshold. I also have to use pillow and not opencv.</p>
  
  <p>Left right reflection</p>
  
  <pre><code>def leftRightReflected(self):
          image1 = Image.open(self.ravenFigure1.visualFilename)
          image1 = image1.filter(ImageFilter.GaussianBlur)
          image2 = Image.open(self.ravenFigure2.visualFilename)
          image2 = image2.filter(ImageFilter.GaussianBlur)
          left_right_mirror = image1.transpose(Image.FLIP_LEFT_RIGHT)
          return ImageChops.difference(left_right_mirror,image2).getbbox() is None
  </code></pre>
  
  <p>Top down reflection</p>
  
  <pre><code>def topDownReflected(self):
      image1 = Image.open(self.ravenFigure1.visualFilename)
      image1 = image1.filter(ImageFilter.GaussianBlur)
      image2 = Image.open(self.ravenFigure2.visualFilename)
      image2 = image2.filter(ImageFilter.GaussianBlur)
      top_bottom_mirror = image1.transpose(Image.FLIP_TOP_BOTTOM)
      return ImageChops.difference(left_right_mirror,image2).getbbox() is None
  </code></pre>