Sir I saw the image on telegram, hope I understand the question, One way is-
- Convert RGB to Gray
- Gray Image to Binary with adjusting threshold value (As minimum as possible), so that only lines are remain.
- Consider the binary image as mask, and fill the pixels region in original image as per your requiremnts.
- You may apply the average filter to smooth the image on lines and non lines area.
GrayImage(mask)=pixel_val; choose any pix_val, which is pixel value near equal to non lines region.