= grid_size; j <= w; j += grid_size) {
        context.moveTo(j, 0.0);
        context.lineTo(j, h);
    }
    context.strokeStyle="#999999";
    context.lineWidth=1;
    context.stroke();
    context.closePath();    
    
    // contour
    var do_colors = document.getElementById("do_colors").checked;
    for(var i = 0; i <= h - grid_size; i += grid_size) {
        for(var j = 0; j <= w - grid_size; j += grid_size) {
            var do_horizontal = 
                pixel_in(j + 0.5 * grid_size, i - 0.5 * g