There are many ways to extract the line from its background. This tutorial is applicable to solid or similar color background. This technique is commonly used to extract signature. We will use sample signature as shown in the figure.
Open the file and adjust the level until you get the contrast color. Press Crt+L to open level settings. Experiment on the level input to get the better contrast between the background and the lines. This will help the magic wand to select and remove similar color. Try to grow the selection if you want to cover more area. Select the line and inverse the selection by pressing Crt+Shift-I . Delete the background.