Dermoscopy is one of the major imaging modalities used in the diagnosis of melanoma and other pigmented skin lesions. Due to the difficulty and subjectivity of human interpretation, automated analysis of dermoscopy images has become an important research area. Border detection is typically the first step in this analysis yet is often limited by the quality of the images to be analyzed. In this paper, we present an effective method to enhance the contrast in dermoscopy images. Given an input RGB image, we determine the optimal weights to convert it to grayscale by maximizing a histogram bimodality measure. Experiments on a large set of images demonstrate that this adaptive optimization scheme increases the contrast between the lesion and the background skin, and leads to a more accurate separation of the two regions using Otsu's thresholding method.