Simple  algorithm  of  registration  of  level  lines  of  two-dimensional functions  on  the  discrete  raster.

Russian

Shulga V.I.

https://shulga.tripod.com/mixt_2/levelin/E.htm

The main idea.

"Not to catch" hit of the function value into the neighbourhood of any level, but to register hit of the value in the interval of values between the neighbour points.

Such tactics enables to solve the problem simply, confidently and precisely. Lines are not ovewrlokexd, their thickness makes one pixel.