vendor/kinetic-v5.1.0.js
function(config) {
            var cb = config.callback;

            config.callback = function(dataUrl) {
                Kinetic.Util._getImage(dataUrl, function(img) {
                    cb(img);
                });
            };
            this.toDataURL(config);
        }
function(config) {
            var cb = config.callback;

            config.callback = function(dataUrl) {
                Kinetic.Util._getImage(dataUrl, function(img) {
                    cb(img);
                });
            };
            this.toDataURL(config);
        }
function ( config ) { var cb = config . callback ; config . callback = function ( dataUrl ) { Kinetic . Util . _getImage ( dataUrl , function ( img ) { cb ( img ) ; } ) ; } ; this . toDataURL ( config ) ; }
converts stage into an image.
@method
@memberof Kinetic.Stage.prototype
@param {Object} config
@param {Function} config.callback function executed when the composite has completed
@param {String} [config.mimeType] can be "image/png" or "image/jpeg".
"image/png" is the default
@param {Number} [config.x] x position of canvas section
@param {Number} [config.y] y position of canvas section
@param {Number} [config.width] width of canvas section
@param {Number} [config.height] height of canvas section
@param {Number} [config.quality] jpeg quality.  If using an "image/jpeg" mimeType,
you can specify the quality from 0 to 1, where 0 is very poor quality and 1
is very high quality
converts stage into an image .