Convert raw bitmap data from HTMLCanvasElement to JPEG or PNG format and return as DataURL.