Canvas.toDataURL image type performance

Benchmark created by Krisztian SUGAR on


Description

Tests toDataURL image types with a large canvas

Preparation HTML

<canvas width="4000" height="3000" style="display:none;">
</canvas>

Setup

c = document.getElementsByTagName("canvas")[0];
    ctx = c.getContext("2d");

Test runner

Ready to run.

Testing in
TestOps/sec
empty parameter
data = c.toDataURL();
ready
image/png
data = c.toDataURL("image/png");
ready
image/jpeg
data = c.toDataURL("image/jpeg");
ready
image/webp
data = c.toDataURL("image/webp");
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.