title: Filling gaps in shape edges
body: <p>Is there an algorithm that would perform well in terms of filling holes like those on the sample image? Dilation doesn't work well, cause before I eventually manage to connect ends of those curves, the curves get really thick. I'd like to avoid thickening the lines. Thank you for any help.</p>
  
  <p><img src="https://i.stack.imgur.com/EsmKh.png" alt="enter image description here"></p>
  
  <p>Yes, there can be just any letter or shape in the image with holes like those.</p>