def draw_root_fret_markers(draw, instrument, text_top_area,
    text_bottom_area, image_height, palette):
    """Add the fret markers to the root finder image"""
    for fret_pos in instrument.marker_positions:
        x_pos = instrument.margin / 2 + instrument.nut_width / 2 + fret_pos * (
            instrument.fret_spacing / 4) - instrument.fret_spacing / 8
        if fret_pos in instrument.double_markings:
            y_pos = text_top_area + (image_height - text_top_area -
                text_bottom_area) / 3
            draw.ellipse((x_pos - instrument.marker_size / 3, y_pos - 
                instrument.marker_size / 3, x_pos + instrument.marker_size /
                3, y_pos + instrument.marker_size / 3), palette.
                fret_marker_colour)
            y_pos = image_height - text_bottom_area - (image_height -
                text_top_area - text_bottom_area) / 3
            draw.ellipse((x_pos - instrument.marker_size / 3, y_pos - 
                instrument.marker_size / 3, x_pos + instrument.marker_size /
                3, y_pos + instrument.marker_size / 3), palette.
                fret_marker_colour)
        else:
            y_pos = (image_height - text_top_area - text_bottom_area
                ) / 2 + text_top_area
            draw.ellipse((x_pos - instrument.marker_size / 3, y_pos - 
                instrument.marker_size / 3, x_pos + instrument.marker_size /
                3, y_pos + instrument.marker_size / 3), palette.
                fret_marker_colour)
    return draw
