title: Robot framework: Extent image compare function
body: <p>I've writen my own image compare function for RobotFramework with the help of a question asked over here. </p>
  
  <pre><code>from PIL import Image, ImageChops, ImageDraw, ImageFont
  def check_image_files(self, file1, file2, file3)                :
      ''' Check two image files
  
      ``file1``: absolute path to the first file
  
      ``file2``: absolute path to the second file
  
      ``file3``: absolute path to the compare file
      '''
  
      self.builtin.log("File1: %s" %file1)
      self.builtin.log("File2: %s" %file2)
  
      point_table = ([0] + ([255] * 255))
  
      f1 = Image.open(file1)
      f2 = Image.open(file2)
  
      diff = ImageChops.difference(f1, f2)
      diff = diff.convert('L')
      diff = diff.point(point_table)
      f3 = diff.convert('RGB')
      f3.paste(f2, mask=diff)        
      f3.save(file3)
  </code></pre>
  
  <p>The end result now is a complete black screen if there are  no differences found in the file, but I want to get a true / false back. So I can let the testcase PASS / FAIL if the 2 files are not identical. Now the testcase succeeds if the files are not identical for a small part and that's not what I want.</p>
  
  <p>I've read the PIL documentation but couldnt get what I needed (btw I'm a tester with a interest for Programming)</p>