Stray light is the main source of noise on the Thomson scattering diagnostic images of the TJ-II stellarator. The diagnostic provides temperature and density profiles of the plasma. A charge-coupled-device camera acquires images that are disturbed by noise, which, in some cases, can produce unreliable profiles. In this paper we describe three different approaches to reduce or mitigate the stray light on these images: exhaustive detection, extraction of regions with connected components, and extraction of regions with the approach of region growing. The performance of the two most interesting techniques is evaluated by a validation process. This process quantifies the noise eliminated by each method.