e; i <= h; i += pixel_size) {
        context.moveTo(0.0, i);
        context.lineTo(w, i);
    }
    for(var j = pixel_size; j <= w; j += pixel_size) {
        context.moveTo(j, 0.0);
        context.lineTo(j, h);
    }
    context.strokeStyle="#AAAAAA";
    context.lineWidth=1;
    context.stroke();
    context.closePath();
    
    // spline grid
    context.beginPath();
    for(var i = grid_size; i <= h; i += grid_size) {
        context.moveTo(0.0, i);
        context.lineTo(w, i);
    }
    for(var j 