Melanocytes are specialized cells located in the stratum basale of the epidermis. They produce melanin, the pigment responsible for skin color. Melanin protects the skin from the harmful effects of ultraviolet (UV) radiation by absorbing and dissipating the radiation.