def add_grid_lines(map_file, op_file, grid_spacing):
    """
    makes a new image 'op_file' from 'map_file' with
    a grid overlayed on it
    """
    from PIL import Image
    from PIL import ImageDraw
    img = Image.open(map_file)
    width, height = img.size
    draw = ImageDraw.Draw(img)
    y_start = 0
    y_end = img.height
    for x in range(0, img.width, grid_spacing):
        line = (x, y_start), (x, y_end)
        draw.line(line, fill=128)
    x_start = 0
    x_end = img.width
    for y in range(0, img.height, grid_spacing):
        line = (x_start, y), (x_end, y)
        draw.line(line, fill=128)
    del draw
    img.save(op_file, 'jpeg')
