code: function loadFile() {
      // Save settings
      saveSettings();
  
      console.log('file:', file);
      $downloadGCode.hide();
      $downloadHeightMap.hide();
  
      // Create RasterToGcode object
      rasterToGcode = new RasterToGcode.RasterToGcode(settings);
  
      // Register events callbacks
      rasterToGcode.on('progress', function(event) {
          console.log('onProgress:', event.percent);
          $progressBar.css('width', event.percent + '%').html(event.percent + '%');
      })
      .on('done', function(event) {
          $toHeightMap.text('To HeightMap').removeClass('btn-danger');
          $toGCode.text('To G-Code').removeClass('btn-danger');
          $progressBar.css('width', '0%').html('0%');
          $progressBar.parent().hide();
  
          if (event.heightMap) {
              console.log('onDone: heightMap:', event.heightMap.length);
              heightMap = event.heightMap;
              $downloadHeightMap.show();
              return;
          }
  
          console.log('onDone: lines:', event.gcode.length);
          gcode = event.gcode.join('\n');
          $downloadGCode.show();
      })
      .on('abort', function(event) {
          console.log('onAbort:', event);
          $toGCode.text('To G-Code').removeClass('btn-danger');
          $toHeightMap.text('To HeightMap').removeClass('btn-danger');
          $progressBar.html('Aborted at ' + $progressBar.html()).addClass('progress-bar-danger');
      });
  
      // <file> can be Image, File URL object or URL string (http://* or data:image/*)
      rasterToGcode.load(file).then(function(rtg) {
          console.log('rasterToGcode:', rtg);
          $explorer.removeClass('left');
          $explorer.addClass('right');
          drawCanvasGrid(rtg);
      })
      .catch(function(error) {
          console.error('error:', error);
      });
  }
docs: Load file...