Creating Distance Transform, working out how best to do per-pixel operations