Introduction

The world is beautiful as the people are. Lush green grasses, a variety of flowers, shady trees, herbal shrubs, a water ecosystem, etc. all are adding to the charm of the globe (Khan 2022). With the advancement of knowledge where every field is progressing, the color industry has also gained its share in all fields (Vogel et al. 2022). After the discovery of Mauvein by Perkin, the world of synthetic dyes has opened new horizons and the traditional art of natural dyes declined (Mahmoudpour et al. 2021). Although synthetic dyes are cheap and provide brilliant shades, yet their frequent uses for all fields have been observed keenly (Sonal and Mishra 2021). The majority of synthetic dyes contain such mediators that are carcinogenic, mutagenic, and nonrenewable (Patel et al. 2021). After their utilization, either by changing water quality parameters or by decreasing soil fertility, air quality index, and destruction of Agri-land (Worlanyo and Jiangfeng 2021) damage the eco-balance of the environment (Peter et al. 2021). It also affects the equilibrium of the environment by raising the water’s high pH. Due to such reasons, many synthetic dyes have been banned internationally by environmental organizations (Affat 2021). To protect the environment globally, they now promote green products such as either by forcing industries to include eco-label or by giving awareness through seminars, conferences, projects, etc. (Mungkung et al. 2021).

Natural dyes are functional bioactive dyeing molecules that extracted from natural sources (Zhang et al. 2021). These dyes are nontoxic, renewable, easily biodegradable, and possess pollution-free effluents (Singh et al. 2021). These dyes act as health remedies, and even their crude waste acts as fertilizers for the soil. These dyes can create distinctive and calming hues and even with time, the shades become better. Hence, the revival of bio colorants for all fields to make the process eco-friendly and to retain the traditional art of dyeing is on the way (Panda et al. 2022). For improving extraction yields, modern approaches have been adopted such as microwave treatment and for shade permanency, bio-mordants have been selected (Al-Sayed and Abdelrahman 2021). The use of microwave radiation (MW) as green heating technology has been included to get a high yield of colorant (Al-Sayed and Abdelrahman 2021). Microwave-aided extraction (MAE) is the approach that produces natural dyes with the highest yield of all by causing excellent mass transfer (colorant) into a solvent through a leveled and uniform heating process (Zin et al. 2022). Although natural dyes are classic dyes with numerous ayurvedic and biological characteristics, their isolation and shade permanency are the key drawbacks (Hamdy et al. 2021). Some conventional methods are used to extract the colorant. Still, these classic methods are time-, solvent-, economy-, and labor-consuming, and even if the heating process becomes prolonged, the functional moiety faces hydrolysis (Arabi et al. 2021; Adeel et al. 2023a). Hence their extraction require noval tools such as MW rays. For shade permanency, the salts of Cu, Cr, Co, Ni, Fe, and Al, etc., are used, but their effluents also pollute the water and, in turn, become dangerous for the ecosystem (Uddin et al. 2022). Bio-mordants are plant based functional molecules that have also a tendency to color substrate (Dulo et al. 2022; Barkaat et al. 2023). These bioactive through extra interaction with colorant and fabric produce variable gamutes onto various types of fibers used. In light of the benefits of cost-effective and eco-friendly nature of this isolation technique, the current study has been designed to explore the coloring potency of Opuntia ficus fruit (Fig. 1a) through microwave rays and to utilize sustainable mordants for getting permanent shades. Opuntia ficus is one of the members of the Cactaceae family that contain betalain as a potential coloring molecule (Fig. 1b) that impart color onto fibers (Barba et al. 2022). It is used for anti-inflammatory, hypocholesterolemic, pharmacologic, and antioxidant properties and as a medicine to treat diabetes (Sabtain et al. 2021).Wool is a well-known textile fabric because of its distinctive characteristics, which include smoothness and softness, resistance to wrinkles, heat and fire, high absorbency, flexibility, and resiliency (Salleh et al. 2021). The fiber is composed of keratin that has been joined together with peptide bonds (Shavandi et al. 2021). The amide linkage (Fig. 1c) is responsible for binding with dye and mordants (Hosseinnezhad et al. 2021a, b).

Fig. 1
figure 1

Opuntia ficus fruit (a), betalain (b) and functional repetition of wool yarn (c)

The main aims of the current study are:

  1. 1.

    To find a sustainable solvent medium for extraction of betalain using selected time of microwave rays

  2. 2.

    To find sustainable dyeing points through central composite design (CCD) as a statistical tool

  3. 3.

    To use a low level of chemical and bio-mordants for getting permanent shades

Materials and methods

Materials required

Opuntia ficus as a source of bio-dye pomegranate peel and Acacia bark, harmal, and neem as a source of bio-mordants were purchased from the local market in Faisalabad, Pakistan. After being cleaned with distilled water, all the cleaned samples were dried, sliced, and ground finely. Woolen yarn samples were provided by the Carpet Department, University of Sistan and Baluchestan, Zahedan, Iran. For shade fastness, commercial-grade mordants such as iron sulfate (FeSO4), aluminum sulfate (Al2[SO4]3), chromium sulpfate (Cr2(SO4)3), and tannic acid (T.A.) were used.

Extraction process

The crude powder of dried Opuntia ficus fruit was sieved and subjected to isolation. The aqueous extract was prepared by heating 4-g crude powder with 100 mL of water at boiling for 45 min. The acidic extract was prepared by boiling 4 g of crude sieved powder with 100 mL of acidic solution (1% HCl). Extracts after filtration and woolen yarns were exposed to microwave (MW) using Dawlance-made domestic Irradiator at high power. The four different sets were designed and used to observe coloring efficiency of Opuntia ficus fruit. In one step, before treatment, the extract was used to dye yarn at 80 ºC for 45 min. In another set, after radiation up to 5 min, the radiated extracts were used to dye radiated yarns at given conditions.

Statistical analysis of dyeing variables

Central composite design (CCD) was formulated under response surface methodology for statistical optimization of the dyeing variable (Chaker et al. 2021). The range taken for the dyeing parameter was: temperature, 55–85 °C; time, 35–65 min; pH 3–7; salt amount, 1 g/100 mL; extract volume 35–65 mL. The trials made have been conducted under various conditions, and the results were assessed through computer simulation.

Mordanting

Using salts of Al, Fe, Cr, and tannic acid, 25 mL of their solutions was used to develop shades onto yarns before and after dyeing at optimized conditions. For comparative studies, plant extracts were obtained by boiling 0.5–2.5 g with 100 mL of water, and the extracts were used before and after the dyeing at given conditions. For this purpose harmal seeds, pomegranate peels, henna leaves, and acacia bark were dried, crushed, and ground finely before being used to extract bio-mordants. Pre- and post-mordanting were carried out at 85 °C for 35 min to improve the shade quality of yarns before and after dyeing (Table 1).

Table 1 Effect of microwave radiation on extraction (acidic and aqueous) and dyeing of wool yarn

Assessment of dyed and undyed materials

The yarns were scanned under the scanning electron microscope to observe the surface modification of the yarn and under ATR-FTIR (Perkin Elmer) to take spectra between the ranges of 400 to 4000 cm−1 for confirmation of active functional groups. The dyed fabric was examined under color spectra photometer CS-410 (China) to get color quality value (K/S, L*, a*, b*). The dyed yarns before and after mordanting were assessed for fastness rating as per ISO standards for light fastness (ISO 105 B02), washing (ISO 105 C03), and rubbing (ISO 105 X-12) (Hosseinnezhad et al. 2021a, b).

Results and discussion

For the isolation of colorants, new modern tools such as microwave irradiations (MWI) are gaining popularity (Kumar et al. 2021). This is because these rays, on interacting with the isolation system, penetrate the solvent and transfer its energy to rupture the plant boundary (Špadina et al. 2021; Nasreen et al. 2023). The boundary, after rupture, evolves functional molecules, and colorant through mass transfer kinetics, and by this powder-liquid match up without consuming more time and solvent, a high yield is observed (Adeel et al. 2023b). Upon dyeing, the yield obtained shows the maximum extent onto surface-tuned fabric (Hassan and Saifullah 2021). The same is the case has been observed in our studies where microwave treatment to both woolen yarn (WY) and the acidic extract was given up to 2 min which has furnished high color depth (K/S = 40.29). Before microwave irradiation (MWI), the acidic extract (NRE) obtained shows less yield onto woolen yarn (K/S = 30.15). The color coordinates show that the shades obtained were draker (L* = 23.87), redder (a* = 22.95), and yellow in hue (b* = 23.87). After 2 min. of microwave treatment (MWI), the shade obtained was much darker (L* = 17.57), more redder (a* = 28.61) but less yellower in hue (b* = 14.14). For the aqueous extract, when employed before radiation, the yield was low (K/S = 8.83) and the shades were brighter (L* = 46.14), with less red (a* = 12.96) but more yellow (b* = 29.87) tone. After radiation of fabric, up to 5 min., the shades were high in strength (K/S = 20. 01), darker (L* = 30.79), and much redder (a* = 24.23), and less yellower in hue (b* = 20.43). The acidic extract (Fig. 2b) has shown an overall high yield on yarn when treated for up to 2 min. as compared to the aqueous extract without radiation used for irradiated wool yarn (Fig. 2a).

Fig. 2
figure 2

Microwave-assisted dyeing of wool yarn fabrics using prickly pear extract in aqueous medium (a) and acidic media (b)

The role of microwave radiation was observed through spectral outlines by FTIR analysis (Figs. 3, 4, and 5) and scanned images (Fig. 4(a, b)) through SEM. The role of MW can be seen in physical changes occured in woolen yarn through scanned images. The results reveal that before radiation, the fiber is smooth (Fig. 3(a)), whereas after radiation, the yarn surface has been peeled (Fig. 3(b)). The peeled surface upon dyeing has sorbed dye significantly. Hence, this uniform and leveled source of heating has modified the fiber physically. Similarly dyed woolen yarn (Fig. 3) also reveals that after radiation, the peeled surface was covered with dye. Previous studies show that these rays tune the fiber physically without causing any change in its chemistry. The chemical nature of yarn has been evaluated by FTIR before and after radiation (Fig. 4(a and b)). The peaks are shown at 3300–3400 cm−1, 1500–1700 cm−1, and 1200 cm−1 representing the presence of amino, carbonyl, and a methyl group. Even after treatment, the spectral lines did not alter their position, which shows that MW treatment does not change the chemical nature of the fiber (Adeel et al. 2023b). The presence of betalain from O. ficus extract before and after radiation was also analyzed by FTIR (Fig. 5 (a and b)). The functional peaks present at 3400 and 3000 cm−1 represented the presence of amino and carboxylic groups. Similarly, in addition to these peaks, the sharp lines present at 1500–1700 cm−1 and 1000–1100 cm−1 represent the presence of CH and OH groups. Similarly, the presence of –C≡H and –C = 0 has been observed at 1500 and 1000 cm−1. Hence, these peaks did not alter their position even after MW treatment. Similarly, the narrow band peaks (Fig. 6 a and b) show that the fiber dyed with betalain extracted from O. ficus has developed some interaction through chemical binding. Then, overall, it can be narrated that MW ray treatment is useful in the modification of fiber without altering the chemical nature of stuff (dye and fiber).

Fig. 3
figure 3

Spectral outlines for functional group present in wool yarn before (a) and after (b) radiation

Fig. 4
figure 4

Spectral outlines for functional group present in O. ficus extract before (a) and after (b) radiation

Fig. 5
figure 5

Spectral outlines of fabrics dyed with O. ficus extracts before (a) and after (b) radiation

Fig. 6
figure 6

SEM images of wool yarn before (a) and after (b) radiation and before dyed yarns before (c) and after radiation (d)

The role of these dyeing variables has been analyzed statistically. For this purpose, a central composite design (CCD) was formulated by varying dyeing patterns through response surface methodology (RSM). A total of 32 experiments were done as briefed in Table 2, and the results obtained were analyzed. The result given in the table shows that 55 mL of acidic extract has 2 g/100 mL of salt after microwave treatment (MWI). Up to 2 min when employed onto irradiated yarn at 85 ºC and 4 pH for 35 min has shown maximum yield (K/S = 34.20). Statistically obtained results show that the model used for analysis is fit and linear (P = 0. 00). Also, the role of pH (P = 0.00), volume (P = 0.06), time (P = 0.00), and salt (P = 0.00) has been highly significant as the individual parameter. The two-way interaction, statistically for the table, reveals that the role of pH, along with volume and time, is highly significant. The role of salt with time, salt with temperature, and salt with volume are also systematically significant. The data shows that the maximum capacity for dye adsorption onto woolen yarn occurs in the pH range of 3–7, with dye adsorption increasing with decreasing pH. This is mostly caused by the protonation of wool amino groups in an acidic environment which is advantageous for ion–dipole interactions with the hydroxyl group of the chemical constituents of Opuntia ficus. Another major element that is frequently studied in the dyeing of textile fibers is temperature. Temperature causes the fiber structure to swell, makes it easier for dye composites to break down, and promotes the diffusion of dye molecules inside the fiber structure (Amesimeku et al. 2021). A large number of functional groups (amine and hydroxyl groups) added to the fiber surface in modified wool not only completely alter the surface morphology compared to that of untreated wool (Al Faruque et al. 2021), but also make them easily accessible to dye molecules, enhancing wool’s ability to absorb dye through ionic interactions, hydrogen bonds, van der Waals forces, and hydrophobic interactions (Lei et al. 2021). Large amounts of energy and dye material can be saved as a result (Allam et al. 2022).

Table 2 Analysis of variance using central composite design for selection of dyeing variables

In this study, 0.5–2.5 g/100 mL of Al, Cr, Fe, and tannic acid were used before and after the dyeing of 1 g of woolen yarn. Chemical mordanting in plant dyeing always needs an additive called mordant to get color-fastness properties (Hosseinnezhad et al. 2023). The mordants are metal electrolytes or tannic acid, which form complexes with fabric through coordinated covalent bonds before and after dyeing (Fig. 7a). Tannic acid forms additional hydrogen bonding with functional groups and dye-binding sites (Birniwa et al. 2022). The dyeing of natural or synthetic fabric with plant pigments or dyes always depends upon chemcial or biomordanting (Loum et al. 2021). The problem of poor fastness can be overcome by metal salts or tannic acid or by plant pigments (Aggarwal 2021; Adeel et al. 2023b). In the present studies, the results show in Fig. 8 (a and b) that before the dyeing of yarn, 2.0% Al, 1.5% of Fe, 2.5% of Cr, and 2.0% tannic acid gave a high yield. Similarly, after dyeing, 2.0% of Al, 1.5% of Fe, 0.5% of Cr, and 2.0% tannic acid developed shades of high strength onto the yarn. The proposed mechanism of plants mordant with yarn and colorant has been given in Fig. 7b. The selected amount of bio and chemical mordants applied before and after dyeing at selected conditions have shown shades of variable tones (Table 3).

Fig. 7
figure 7

Proposed interaction of betalain dye of O. ficus with chemical mordant (a) and bio-mordant (b) for dyeing of wool yarn

Fig. 8
figure 8

Effect of pre (a) and post (b) bio-mordants and pre (a) and post-chemical mordants (B) on woolen yarn dyed with O. ficus extracts

Table 3 Colorfastness properties of woolen yarn dyed with O. Ficus extract before and after chemical and bio-mordants at selected levels

Bio mordanting, also known as dual bio dyeing, is the new art for developing darker shades with new gamutes (Samant et al. 2022). These sources from herbal plants have functional molecules with excellent biological activities due to –OH, –C = O, and –OH groups (Adeel et al. 2023c; Özomay and Akalın 2022). Mostly, these extracts have an excellent place and are well known to treat fetal and seasonal diseases. In this study, four sources of bio-mordant have been introduced in combination with (Opuntia ficus) colorant to develop new gamutes of high strength (Fig. 8(a, b)). The shade quality penetrates given in Table 3 for using bio-mordants before and after dyeing reveal that dual dyeing has resulted in darker shades with more or less reddish yellow hue depending upon the nature of bio-mordants used. Overall, usually before dyeing, the functional group represents in prickly pear on interaction with betalain and woolen yarn as furnished excellent shade depth with darker hue having reddish yellow hue. The presence of bio-mordants in harmal on interaction with betalain and woolen yarn amido linkage has furnished a brighter shade with a less reddish yellow hue. The data shows that the sample washing fastness was excellent (4–5 to 5). The colored samples’ staining showed good fastness with grade. The colored yarns had good light fastness when mordants were used. However, all dyed yarns have seen a one-rating increase in light fastness.

Conclusion

Using natural colorants in the modern world is the recent demand by the globe as an alternative to toxic synthetic colorants. The studies reveal that 55 mL of acidic extract from 4 g of prickly pear (Opuntia ficus) powder of 4 pH when employed onto wool yarn at 85 °C for 35 min has given excellent results. The results reveal that using optimum conditions, the particular amount of chemical and bio-mordants has not only given good color characteristics to wool yarns but also enhanced their fastness rating to light, washing, crocking, dry cleaning, and perspiration. Conclusively, it is recommended that microwave rays should be used to isolate colorant from prickly pear (Opuntia ficus) in acidic, medium, and bio-mordants should be preferred instead of chemical anchors at selected conditions for developing shades of good colorfastness onto wool yarn.