code: def dhash(image, hash_size=8):
      # type: (Image.Image, int) -> ImageHash
      """
      Difference Hash computation.
  
      following https://www.hackerfactor.com/blog/index.php?/archives/529-Kind-of-Like-That.html
  
      computes differences horizontally
  
      @image must be a PIL instance.
      """
      # resize(w, h), but numpy.array((h, w))
      if hash_size < 2:
          raise ValueError(
              "Hash size must be greater than or equal to 2"
          )
  
      image = image.convert("L").resize(
          (hash_size + 1, hash_size), ANTIALIAS
      )
      pixels = numpy.asarray(image)
      # compute differences between columns
      diff = pixels[:, 1:] > pixels[:, :-1]
      return ImageHash(diff)
  
imports: from __future__ import absolute_import, division, print_function
  import sys
  import numpy
  from PIL import Image, ImageFilter
label_desc: Use image node_id 9 for calling a global function with example usage: dhash(image, hash_size) and returns: ImageHash