generate a signed distance field from an image