This only works with browsers supporting canvas.