Minified the canvas-fn