index.js
function (fn) {

		var writeBuffer = new streamBuffers.WritableStreamBuffer({
			initialSize: (100 * 1024), incrementAmount: (10 * 1024)
		});

		fn = fn || function () {};

		this._image.pack().pipe(writeBuffer).once('close', function () {
			this._image.removeListener('error', fn);
			fn(undefined, writeBuffer.getContents());
		}.bind(this)).once('error', function (err) {
			this._image.removeListener('close', fn);
			fn(err);
		}.bind(this));
	}
function (fn) {

		var writeBuffer = new streamBuffers.WritableStreamBuffer({
			initialSize: (100 * 1024), incrementAmount: (10 * 1024)
		});

		fn = fn || function () {};

		this._image.pack().pipe(writeBuffer).once('close', function () {
			this._image.removeListener('error', fn);
			fn(undefined, writeBuffer.getContents());
		}.bind(this)).once('error', function (err) {
			this._image.removeListener('close', fn);
			fn(err);
		}.bind(this));
	}
function ( fn ) { var writeBuffer = new streamBuffers . WritableStreamBuffer ( { initialSize : ( 100 * 1024 ) , incrementAmount : ( 10 * 1024 ) } ) ; fn = fn || function ( ) { } ; this . _image . pack ( ) . pipe ( writeBuffer ) . once ( 'close' , function ( ) { this . _image . removeListener ( 'error' , fn ) ; fn ( undefined , writeBuffer . getContents ( ) ) ; } . bind ( this ) ) . once ( 'error' , function ( err ) { this . _image . removeListener ( 'close' , fn ) ; fn ( err ) ; } . bind ( this ) ) ; }
Writes the image to a buffer

@method toBlob
@param {function} fn Callback
Writes the image to a buffer