This paper explores the use of Chitosan as sustainable agent to improve dyeing properties of cotton fabric dyed with Opuntia ficus-indica L fruit peel and the determination of the amount of anthocyanin pigments by the spectrophotometric method. The results of this study highlights that cotton fabrics treated with chitosan have better depth of shade (K/S = 12) than those untreated fabrics (K/S = 3.7) dyed with Opuntia ficus-indica L fruit peel. We have thoroughly investigated the effects of dye bath pH and temperature on the color properties of the aforementioned fabrics. UV protection of cotton fabrics increased after natural dyeing, and it was further improved after being treated with chitosan. Experimental results show that the fastness properties of dyed cotton fabrics treated with chitosan were improved from average to excellent.