util.imageToDataUri(url, callback)

Convert an image at url to the Data URI scheme. The function is able to handle PNG, JPG and SVG formats. Useful if you need to embed images directly into your diagram instead of having them referenced externally.

The callback function has the following signature: function(err, dataUri) {}.