Pure JS implementation of an image drawing and encoding api, based on HTML Canvas