I’ve been searching for how to save an HTML5
<canvas> as an image in any format other than PNG? (e.g. JPEG, BMP, GIF, ICO)
There’s an example at MDN – A way to convert a canvas to an ico which might help you. It says Mozilla only, but suggests that other browsers might be made to work.