Skin detection plays a very essential role in many image processing applications such as face localization, face recognition, gesture recognition and human identification. A robust pre-processing skin detection algorithm can significantly increase the performance of an application in both terms of speed and accuracy. Skin segmentation is often computationally simple, though in many conditions, uneven and nonlinear illumination degrades its performance. Recently, many methods have been proposed to solve the problem, yet most of them are not applicable in different conditions and disparate illuminations. This paper proposes an algorithm which employs not only a pixel-based processing, but also an additional neighbor-based and region-based processing. This enhances the output of the algorithm. Also a novel method in which the YC b C r image is converted to a ternary image by means of a set of decisive rules is employed. In a further processing stage, a region-based algorithm is used to decide with a high certainly on the pixels which are not skin. Results demonstrate that the proposed algorithm is robust and capable of detecting skin windows comparable with state of the art algorithms.