code: function (img, downScaleSize, threshold) {
          if (!img || !img.width || !img.height) {
              return false;
          }
  
          var canvas = document.createElement('canvas');
          var ctx = canvas.getContext('2d');
          var size = downScaleSize || 32;
          threshold = threshold || 20;
          canvas.width = canvas.height = size;
          ctx.drawImage(img, 0, 0, size, size);
          var srcData = ctx.getImageData(0, 0, size, size);
          for (var i = 0; i < srcData.data.length; i += 4) {
              var r = srcData.data[i];
              var g = srcData.data[i + 1];
              var b = srcData.data[i + 2];
              var diff = Math.abs(r - g) + Math.abs(g - b);
              if (diff > threshold) {
                  return false;
              }
          }
          return true;
      }
docs: Convert height map to normal map
  @param {HTMLImageElement|HTMLCanvasElement} image
  @param {boolean} [checkBump=false]
  @param {number} [threshold=20]
  @return {HTMLCanvasElement}