<!DOCTYPE html>
<html>
<style>
    canvas {
        width: 300px;
        height: 300px;
    }
</style>    
<body>
    <canvas id="canvas"></canvas>
    <script>
        if (window.internals)
            internals.settings.setLargeImageAsyncDecodingEnabled(true);

        let image = new Image;
        image.onload = (() => {
            let canvas = document.getElementById("canvas");
            let context = canvas.getContext("2d");
            context.drawImage(image, 300, 0, canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);
        });
        image.src = "resources/red-green-blue-900-300.png";
    </script>
</body>
</html>
