Image segmentation and edge detection are the most important presteps in machine vision, and their successfulness can affect the success of the next steps. In this paper, the performance of the Trahanias edge detector in different color spaces, such as RGB, YCbCr, HSI, and CIE Lu'v', is compared in order to find the best color space for image segmentation and edge detection. We then offer an efficient edge-preserving algorithm for color contrast enhancement in the CIE Lu'v' space. The proposed algorithm can increase the color contrast, which causes a remarkable improvement in image segmentation and edge detection in the CIE Lu'v' color space. Moreover, it can efficiently reduce the number of spurious edges that may be produced during the color contrast enhancement process. The results obtained by applying the proposed algorithm, as compared with those by applying another recently introduced algorithm, demonstrate the better performance of the proposed algorithm.