  We introduce novel mathematical and computational tools to develop a complete
algorithm for computing the set of non-properness of polynomials maps in the
plane. In particular, this set, which we call \emph{the Jelonek set}, is a
subset of $\mathbb{K}^2$ where a dominant polynomial map
$f:\mathbb{K}^2\to\mathbb{K}^2$ is not proper; $\mathbb{K}$ could be either
$\mathbb{C}$ or $\mathbb{R}$. Unlike all the previously known approaches we
make no assumptions on $f$ whenever $\mathbb{K} = \mathbb{R}$; this is the
first algorithm with this property. The algorithm takes into account the Newton
polytopes of the polynomials. As a byproduct we provide a finer representation
of the set of non-properness as a union of semi-algebraic curves, that
correspond to edges of the Newton polytopes, which is of independent interest.
Finally, we present a precise Boolean complexity analysis of the algorithm and
a prototype implementation in Maple.
