Interpolation using a Threshold-based variable number of gradients

figure 8