code: function(callback) {
  
        if (this.filters.length === 0) {
          this.setElement(this._originalImage);
          callback && callback();
          return;
        }
  
        var isLikelyNode = typeof Buffer !== 'undefined' && typeof window === 'undefined',
            imgEl = this._originalImage,
            canvasEl = fabric.document.createElement('canvas'),
            replacement = isLikelyNode ? new (require('canvas').Image) : fabric.document.createElement('img'),
            _this = this;
  
          if (!canvasEl.getContext && typeof G_vmlCanvasManager != 'undefined') {
            G_vmlCanvasManager.initElement(canvasEl);
          }
  
        canvasEl.width = imgEl.width;
        canvasEl.height = imgEl.height;
  
        canvasEl.getContext('2d').drawImage(imgEl, 0, 0, imgEl.width, imgEl.height);
  
        this.filters.forEach(function(filter) {
          filter && filter.applyTo(canvasEl);
        });
  
         /** @ignore */
        replacement.onload = function() {
          _this._element = replacement;
          callback && callback();
          replacement.onload = canvasEl = imgEl = null;
        };
        replacement.width = imgEl.width;
        replacement.height = imgEl.height;
  
        if (isLikelyNode) {
          var base64str = canvasEl.toDataURL('image/png').replace(/data:image\/png;base64,/, '');
          replacement.src = new Buffer(base64str, 'base64');
          _this._element = replacement;
  
          // onload doesn't fire in node, so we invoke callback manually
          callback && callback();
        }
        else {
          replacement.src = canvasEl.toDataURL('image/png');
        }
  
        return this;
      }
docs: Applies filters assigned to this image (from "filters" array)
  @mthod applyFilters
  @param {Function} callback Callback is invoked when all filters have been applied and new image is generated