Contour extraction of images