<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>img.js - Example mask</title>
    <script src="build/img.js"></script>
    <script>
        window.onload = function () {
            var iCanvas = new img.ImageCanvas(600, 450);

            var layer = iCanvas.addLayer('images/img1.jpg');
            layer.addFilter('rgbAdjust', {r: 0.25, g: 0.25});

            layer = iCanvas.addLayer('images/img2.jpg');
            layer.addFilter('rgbAdjust', {r: 0.30, g: 0.20, b: 0.35});
            layer.opacity = 0.5;

            var mask = layer.mask.addLayer({startColor: 'white', endColor: 'black', type: 'radial', spread: 0.97});
            mask.width = mask.height = 360;

            iCanvas.render(function (canvas) {
                document.body.appendChild(canvas);
            });
        };
    </script>
</head>
<body id="root">
</body>
</html>
