A Parallel Thinning Algorithm for Grayscale Images