optimize-pngs_2.py 197 B

123456
  1. def content_hash(filename):
  2. '''Return hash of RGBA contents of image'''
  3. i = Image.open(filename)
  4. i = i.convert('RGBA')
  5. data = i.tobytes()
  6. return hashlib.sha256(data).hexdigest()