1 Introduction

Today, food contamination is a part of the major challenges of our daily lives. It can be destroyed due to bacterial contamination as well as storage and transportation conditions [1]. Generally, the packaging procedure was initially used as a barrier to protect the food product from moisture, oxygen, and contaminants. This procedure still has limitations, such as the tracking of the changes that occur during the storage, delivery, and transportation of food products. Consumers usually judge the quality and freshness of packaged foods based on the shelf life indicated on the package. However, for some products, such as meat, fish, fresh fruits, and vegetables, it’s not always the case. In this regard, the use of an intelligent and active packaging system, permitting the control of packaged foods momentarily and extends their shelf-life by limiting the formation of bacteria, has become a crucial alternative to ensure that food products are monitored in terms of quality and freshness. Many technologies have been set up to solve this problem, namely: the use of smart labels [2], radio frequency identification [3], electronic noses [4], Sensor and biosensor [5, 6] as well as chemical or biological indicators, including oxygen indicators, freshness indicators, and pH indicators [7,8,9].

In particular, the pH-responsive color-change is useful to develop smart packaging films for food industry application [10]. These materials consist of two important components; a pH-sensitive dye and a biopolymer matrix used to prevent bacterial contamination. In this regard, natural, inexpensive, biodegradable, and non-toxic dyes extracted from plant tissues such as alizarin, curcumin, arnebia, anthocyanin, etc. have been tested as a color change agent that is sensitive to pH [11,12,13,14]. Anthocyanin was the most widely used of those pigments, due to its color-change over a wide pH range, its large availability, its harmlessness, and its useful functions such as its antimicrobial and antioxidant activities [15]. For example anthocyanins obtained from red cabbage (ATC), have the property of varying color according to structural changes at different pH levels [16]. Their main chemical formula belongs to the family of polyphenol-based flavonoids (2-phenyl benzo pyrylium), presenting a red color at low pH. It changes from purple or blue at neutral pH to green at basic pH [17].

The polymer matrix is the second element of an active and intelligent packaging. It displays a critical role of the anthocyanin immobilization, while preventing the diffusion of water and oxygen, maintaining the quality of the food and extending its shelf-life. Thus, a variety of natural biopolymers can promote this role, such as pectin [18], cellulose nanofibers [19], gelatin [20], ethylene–vinyl acetate nano-composites [21] and polyvinyl alcohol (PVA)/starch bio composites [22]. Chitosan (CS) is a non-toxic, natural, biocompatible, and biodegradable polymer derived from chitin, which can be taken from the shells of crabs and shrimp [23, 24]. Chitosan is a polyaminosaccharide produced by deacetylation of chitin and has a high molecular weight, formed by (1-4)-2-amino-2-deoxy-β-D-glucan and (1-4)-2-acetamido-2-deoxy-β-D-glucan. Because of their high filmogenic characteristics and advantageous biological activities, such as its antimicrobial activity, chitosan can be used as a film for food packaging [25, 26]. However, chitosan films have poor mechanical properties, in particular a brittle behavior and a low elongation at break. To overcome this problem, CS can be blended with other polymers having more flexible chains, such as poly (vinyl pyrolidone) (PVP) [27, 28]. PVP is a synthetic, linear, non-toxic, biocompatible, water-soluble polymer with high flexibility and very low gas permeability [29, 30]. Due to its excellent film-forming properties, PVP has had many applications in various sectors, like food packaging [31], gas detection [32], biomedical [33, 34], etc. The possibility of blending CS and PVP has been tested by [35], and they noted that the hydroxyl and amine groups present in chitosan and interact with carbonyl groups of the pyrrolidone rings of PVP via the formation of hydrogen bonds, thus generating a biocompatible and homogeneous blending matrix with new characteristics.

In order to improve the bio-nano-composite film properties, a combination protocol of biopolymer and nanomaterials has been proposed, to confer additional functionalities and enhance the characteristics of the films [36,37,38,39]. Sulfur nanoparticles (SNPs) are part of these functional nanomaterials, which improving the thermal, mechanical and biological properties of bio-nano-composite film [18, 40,41,42]. Due to their outstanding chemical and physical properties, SNPs can be incorporated into the polymer formulation in order to obtain a film with excellent performance adapted to the applications of the food packaging industry.

In this research work, a novel active and pH-responsive color-changing polymer-based films was developed using evaporative casting method. The films were made by incorporating red cabbage anthocyanins into the biopolymer matrix based on chitosan and poly (vinyl pyrolidone) and reinforced with sulfur nanoparticles. The characterizations of the films were performed by FTIR, XRD, SEM and TGA. The film's properties such as water vapor barrier, transparency, UV barrier, surface color, surface wetting, mechanical properties, antioxidant, and antibacterial activities have also been studied. In addition, the film prepared was used as an intelligent and active packaging film that allows real-time quality control of meat products and extension of their shelf life by inhibiting microbial development, with the goal to enhance the risks identification in food supply chain and reduce the food wastage.

2 Materials and Methods

2.1 Materials

Chitosan (CS, High molecular weight), acetic acid, chloridric acid, anhydrous calcium chloride (CaCl2), sodium hydroxide (NaOH) and DPPH were provided by Sigma Aldrich. Polyvinylpyrrolidone (PVP, Molecular weight. 58,000) was purchased from Alfa Aesar. Sodium Thiosulphate Pentahydrate (purity > 99%) was obtained from loba chemie. Organic solvents such as methanol and ethanol were supplied from Sigma Aldrich. The red cabbage was acquired on the local market for anthocyanin extraction (ATC). Microorganisms responsible for pathologies like Staphylococcus aureus and Escherichia coli ATCC 25922 were used for the antibacterial studies.

2.2 Synthesis of SNPs

Sulfur nanoparticles (SNPs) were synthesized according to the described procedure [42]. Firstly, aqueous solution (900 ml) containing sodium thiosulfate pentahydrate (2.482 g) was mixed with 0.2 M HCl solution (100 ml) under sonication for 40 min. After that the solution color varied from colorless yellow to cloudy indicating the formation of SNPs. The resulted SNPs were recovered by centrifugation then washed and dried at 60 °C overnight.

2.3 Anthocyanin Extraction from Red Cabbage

180 g of fresh red cabbage was introduced into 80 ml of a solution of water and ethanol (volume ratio of 3:7), then the pH was adapted to 2.0 by HCl solution of 1.0 M. The obtained solution was stored at 5 °C for 12 h in the dark, followed by centrifugation at 4000 rpm for 10 min. Subsequently, the resulting substance was adjusted to pH 7 by adding 2.5 M NaOH solution.

2.4 Preparation of CS@PVP-ATC-SNPs Bio-Nanocomposite Films

The preparation method of the films was based on an evaporation casting procedure (Scheme 1). In this regard, chitosan (1 g) was mixed with 50 ml of distilled water (1% acetic acid) with agitation for 5 h to make a homogeneous solution. In parallel, different percentages of SNPs (1%, 2%, 3%, 4%, 5%) were introduced into 50 ml of distilled water followed by sonication for 30 min, then to this solution 1 g of PVP was added and stirred for 1 h. The two solutions of CS and SNPs-PVP were mixed, and the colored ATC solution (45.8 mg/ml) was introduced into the mixture and stirred for 1 h in the dark. Finally, the obtained films by the casting method were designated CS, CS@PVP, CS@PVP-ATC and CS@PVP-ATC-SNPs (1-5), respectively, according to the film constituent and SNPs concentration.

Scheme 1
scheme 1

Process for the preparation of CS@PVP-ATC-SNPs films

2.5 Film Characterization

2.5.1 FTIR Analysis

The chemical structure of the synthesized CS, PVP, ATC and CS@PVP, CS@PVP-ATC films was studied by Fourier transform infrared spectroscopy (SHIMADZU Affinity-1S) in the range of 500–4000 cm−1.

2.5.2 X-Ray Diffraction (XRD)

Bio-nano-composite film crystallinity was studied using X-ray diffraction (XRD). For this purpose, a rectangular sample (2 cm × 2 cm) was positioned on a slice of glass and the Cu Ka radiation source (λ= 1.5438 Å) was used to record the XRD pattern of the samples in a range of diffraction angles 2θ = 10–50° at room temperature.

2.5.3 Water Absorption

The water absorption capacity (WA) of the prepared films was determined as indicated by [36]. In brief, 20 mm sample squares were dry at 60 °C for 24 h. The samples were then weighed (Wi) and immersed in 20 ml of distilled water for 24 h. The samples were periodically (hourly) taken out and weighed (Wf) after dabbing the adhering droplets of water on the surface with a filter paper, and then rapidly immersed in the test vial. The drying and weighing process was performed several times for each sample tested until equilibrium swelling was reached. The WA was calculated according to the following equation:

$$WA \left(\%\right)=\frac{Wf-Wi}{Wi} \times 100$$

2.5.4 Moisture Absorption

Moisture absorption (MA) tests were performed in accordance with the standard ASTM E104-02. Generally, rectangular samples of the prepared bio-nanocomposite films (2 cm × 2 cm) were initially dried at 60 °C for 24 h. Then, placed in the climate chamber (Temperature 25 °C; relative humidity (RH) 75 ± 0.5%), Afterwards, the samples were weighed (Wt) every hour within 6 h. The MA of the prepared films was determined by the following equation:

$$MA \left(\%\right)=\frac{Wt-Wi}{Wi} \times 100$$

2.5.5 Water Contact Angle (WCA) and Water Vapor Permeability (WVP)

The surface hydrophobicity of the bio-nanocomposite films was determined using an automatic contact angle apparatus (OCA 40, DATAPHYSICS), which measuring the drop contact angle of water deposited on the film surface. The film sample prepared (2 cm × 2 cm) was put on a horizontal moving tray (7 cm × 11 cm) of the analyzer WCA, and then a drop of 10 µl distilled water was deposited on the film surface.

Water Vapor Permeability (WVP) was determined in accordance with the standard ASTM E96/E96M, with some modifications. For this purpose, 4 g of calcium chloride anhydrous (CaCl2) (relative humidity RH = 0%) is introduced into cells, and the samples are placed on the circular orifices of the cells. The samples were weighed and incubated into a climatic chamber (RH 50%) at 32 °C. The passage of water vapor has been estimated based on the obtained weight of the permeation cells. In order to plot the linear slope of the variation of the mass with time and to determine the water vapor transmission coefficient (WVT) expressed in g m2 s, six weight measurements of each sample were made over a period of 6 h. The water vapor permeability (WVP) expressed in (g m−1 s−1 Pa−1) was calculated using this formula:

$$WVP=\frac{WVT}{\Delta P} \xi = \frac{WVT}{P(R1-R2)} \xi $$

where ξ is the film thickness (m), P is the pressure of saturating vapor (Pa) at (25 °C), and R1 and R2 are the relative humidity in the glass bottle (0%) and the climate chamber (50%), respectively.

2.5.6 Optical Properties

UV–Vis absorption spectroscopy was exploited to observe the modification of the optical properties of the films after the incorporation of anthocyanins (ATC) and sulfur nanoparticles (SNPs). The films have been cut into a rectangular sample (3 cm × 3 cm) and fixed between two cells of the spectrophotometer. The UV barrier and the transparency of the films were determined by the light transmission measurement at 280 nm (T280%) and 660 nm (T660%), respectively. The films transparency values were determined by the following equation.

$$\mathrm{Transparence }=\frac{-\mathrm{log}(T660)}{E}$$

where E is the thickness of the films.

2.5.7 Mechanical Properties

The uniaxial tensile properties of the film, including elongation at break (EB), tensile strength (TS), toughness (T) and Yong modulus (YM), were determined by a Shimadzu EZ-SX universal testing machine. Five rectangular samples (1 cm × 80 cm) were cut from each film and dried at 40 °C for 24 h The samples were then mounted between two 1000 N load cells at a transverse speed of 10 mm/min. According to the resulting stress–strain curve obtained, the TS (MPa), EB (%), T(J/m2) and YM (MPa) values were determined.

2.5.8 Thermogravimetric Analysis (TGA)

The thermogravimetric analyzer model TGA Q500 (TA Instruments) was used in order to determine the thermal stability of bio-nanocomposite. The films were heated from 30 to 600 °C under a nitrogen atmosphere.

2.5.9 Antibacterial Effects

The disc diffusion method was chosen to study the antibacterial activity of the films against gram-positive (Staphylococcus aureus) and gram-negative (Escherichia coli) bacteria. The film samples were sterilely cut into 8 mm circles. After sterilization, the circles were spread on the Mueller Hinton agar surface using a bacterial density of approximately 1.5 × 106 CFU/mL. The samples were kept for 24 h at 37 °C and the diameters of the inhibition zones around the cercles were measured.

2.5.10 Antioxidant Effect

The antioxidant effect of the prepared films was determined using the DPPH free radical scavenging activity [21]. Firstly, 0.05 g of each film was introduced into 5 ml of methanol and held for 20 min (solution 1). In parallel, 4.0 mg of DPPH was added to 100 ml of methanol and stirred for 30 min in order to measure the absorbance (Aref) of this solution (solution 2) at 515 nm. Then, 1 ml of (solution 1) was added to 3 ml of (solution 2) with vigorous agitation. The resulting mixture was kept in the dark at room temperature for 30 min and its absorbance was measured at 515 nm (Asample). The antioxidant activity OA (%) was calculated according to the following equation:

$$OA \left(\%\right)= \frac{{A}_{ref} - {A}_{sample}}{{A}_{sample}} \times 100$$

The antioxidant activity of anthocyanins (ATC) was also evaluated to make the comparison.

2.5.11 UV–Vis Spectroscopy Analysis of ATC Solutions

The color changes of the anthocyanin solution as a function of pH ranging from 1 to 14 were measured using a UV–Vis spectrophotometer, and the light absorption spectrum of the anthocyanin solution was obtained in the range of 400 to 800 nm.

2.5.12 Color Response Analysis

The CS@PVP-ATC-SNPs3 film surface area of 1 cm2 was immersed for 5 min in hydrochloric acid solutions with a pH of 2.0 to 6.0 and sodium hydroxide solutions with a pH of 8.0 to 12.0. Once removed, the images of the film were taken with a digital camera. The color change parameters were measured using a data-color spectrophotometer (CM-5; Konica Minolta, Japan), by determining the values of the parameters a* (red-green), L* (brightness) and b* (yellow-blue). The total color difference ΔE was obtained following to equation:

$$\mathrm{\Delta E} = \sqrt{{{\Delta L}^{* 2} +\Delta a}^{* 2}+{\Delta b}^{* 2}}$$

2.5.13 Food Packaging Test

To evaluate the effectiveness of CS@PVP-ATC and CS@PVP-ATC-SNPs3 samples as an indicator film for pH change and also to preserve the food products freshness. A sample of 30 g of meat was placed in film-coated Petri dishes and stored at room temperature for 6 days. Meat pH monitoring was performed according to the protocol described in the literature [43]. Briefly, a 10 g sample was introduced into 90 ml of distilled water under agitation, and the pH was determined by a digital pH meter. In parallel, the color deviation ∆E of the films was measured daily for the duration of the storage, and the images of the meat samples were taken by a digital camera.

3 Results and Discussion

3.1 FTIR

The FT-IR spectra of CS, PVP, ATC and mixtures of CS@PVP and CS@PVP-ATC films are shown in Fig. 1a. FT-IR spectrum of CS shows a wide absorption band at 3340 cm−1 attributed to the stretching vibration of the O–H and N–H hydrogen bands. The peak at 2885 cm−1 is attributed to the C–H stretch. The peaks at 1661, 1534 and 1049 cm−1 reflect, respectively, the carbonyl stretching vibration (C=O), the flexural deformation of N–H, and the symmetrical oscillation of the C–O–C group [44, 45]. The FTIR spectrum of PVP revealed the presence of two peaks at 2966 cm−1 and 1442 cm−1 corresponds to stretching vibrations of C–H bands. The absorption band at 1638 cm−1 is associated to the stretching vibration of carbonyl group (C=O), while the observed band at 1268 cm−1 is attributed to the stretching vibration of the pyrrolidone structure (C–N). The CS@PVP mixture involves the apparition of a peak at 1650 cm−1 with low intensity and shifted to higher frequencies in comparison to the carbonyl band of the PVP. This shift suggests an interaction between chitosan and PVP via hydrogen bonds between C=O of PVP and O–H or N–H of chitosan [27, 46]. The FTIR spectrum of red cabbage extract ATC shows a wide band at 3308 cm−1, assigned to the stretching vibration of the hydroxyl group and a band at 1634 cm−1 related to the C=C stretching vibration in the aromatic compounds in the extract. The band at 1045 cm−1 was attributed to the C–O stretching vibration of the anhydro-glucose ring in flavonoid compounds [10, 19]. Otherwise, the comparison of CS@PVP-ATC films spectra and anthocyanin-free CS@PVP films, highlights a change in the bands present at 1637 cm−1 and 1559 cm−1, with a neat increase in intensity. This tendency proves the incorporation of anthocyanins into the polymer matrix via van der Waals interactions between the amide functionality of chitosan and red cabbage extract [9, 47, 48]. Figure 1b shows the FTIR spectra of SNPs and CS@PVP-ATC films with different percentages of sulfur nanoparticles. From those results, it can be seen that the position of the peaks was not changed after the incorporation of SNPs which suggests there was not any interaction between SNPs and the CS@PVP-ATC matrix.

Fig. 1
figure 1

FT-IR spectra of a CS, PVP, ATC, CS@PVP and CS@PVP-ATC films and b SNPs powder and CS@PVP-ATC-SNPs(1,2,3,4, 5%) films

3.2 XRD

The XRD spectra of SNPs, as well as CS, CS@PVP-ATC and CS@PVP-ATC-SNPs(1,2,3,4,5%) films are illustrated in Fig. 2a and b. The XRD pattern of SNPs Fig. 2a shows the presence of the characteristic diffraction peaks of SNPs crystalline framework located at 2θ = 15.38°, 21.80°, 23.10°, 25.80°, 26.53°, 27.48°, 28.44°, 31.26°, 34.02°, 36.73°, 39.07° and 42.63° which corresponds to the crystal phases: (113), (220) (222), (026), (206), (311), (313), (044), (137), (422), (246) and (319), respectively. In addition, the high resolution of the XRD spectra reflect the good crystallinity of synthesized SNPs [49]. In the Fig. 2b the diffractograms of CS and CS@PVP-ATC bio-composite films showed two broader and less intense diffraction peaks around 2θ = 13° and 2θ = 21.7°, corresponding to the semi-crystalline nature of CS [46]. The incorporation of different percentages of SNPs (1%, 2%, 3%, 4%, 5%) into the CS@PVP-ATC matrix did not show any distinctive peaks characteristic of sulfur nanoparticles, which can be due to the very low SNPs content and the masking effect of the CS matrix [50].

Fig. 2
figure 2

XRD patterns of a SNPs powder and b CS, CS@PVP-ATC and CS@PVP-ATC-SNPs(1,2,3,4, 5%) bio-nanocomposite films

3.3 Morphology

Figure 3 shows the surface morphology of pure CS@PVP-ATC bio-composite films and CS@PVP-ATC films incorporating SNPs. As can be seen in Fig. 3, the pure CS@PVP-ATC film was characterized by smooth surface and compact morphology. However, the bio-composite films incorporating SNPs have a relatively rough surface compared to the CS@PVP-ATC films. The presence of SNPs is visible on the entire surface of the bio-composite films incorporated with sulfur nanoparticles. For CS@PVP-ATC-SNPs films (1%, 2%, 3%) SNPs are dispersed within the film matrix. Moreover, this dispersion appeared more uniform and homogeneous in CS@PVP-ATC-SNPs3 film. On the contrary, an increased percentage of SNPs, leads to an agglomeration of particles within the film, which is the case for the CS@PVP-ATC-SNPs bio-nanocomposite (4% and 5%). We therefore found that a concentration of 3% was optimal for SNPs in the CS@PVP-ATC matrix.

Fig. 3
figure 3

SEM micrographs of a CS@PVP-ATC, b CS@PVP-ATC-SNPs1, c CS@PVP-ATC-SNPs2, d CS@PVP-ATC-SNPs3, e CS@PVP-ATC-SNPs4 and f CS@PVP-ATC-SNPs5 films

3.4 Water Absorption

The water absorption rates (WA) of CS, CS@PVP, CS@PVP-ATC and CS@PVP-ATC-SNPs(1,2,3,4 and 5%) are shows in Fig. 4. The WA value of 341.93% was recorded for pure CS after soaking in water for 24 h. However, the CS@PVP mixture does not exceed 247.91%. This behavior can be explained by the formation of intermolecular hydrogen bonding between hydroxyl group (–OH) of CS and carbonyl group (–C=O) of PVP, reducing the number of free hydrogen bonds in the water, which confirms the infrared spectroscopy results. On the other hand, the calculated WA value of CS@PVP-ATC film is 235.30%, the obtained value didn’t significantly change with the addition of ATC. After adding SNPs to the CS@PVP-ATC mixture, the WA was reduced from 228.18 to 127.21% for the CS@PVP-ATC-SNPs1 to CS@PVP-ATC-SNPs5 films, respectively. This reduction in WA with increasing SNPs percentage may be due to the hydrophobic character of SNPs and its high-water resistance [42].

Fig. 4
figure 4

Water absorption of CS, CS@PVP, CS@PVP-ATC and CS@PVP-ATC-SNPs(1,2,3,4, 5%). bio-nanocomposite films

3.5 Moisture Absorption

Moisture absorption (MA) is a very important factor especially for films dedicated to water-sensitive products packaging or coating. According to Figs. 5 and 6, it was observed that moisture absorption for all samples increased within the first 3 h and the equilibrium moisture content was reached after 4 h. The MA value of the CS film was approximately 21.06% after exposition to 75% relative humidity for 24 h. In addition, it can clearly be seen that the CS@PVP mixture significantly reduced the percentage of moisture absorption by 18.97%, which can be attributed to the reduction of hydroxyl highly hydrophilic functions of chitosan involved in the interaction of CS with the PVP. After the addition of SNPs, the MA continued to decrease from 17.65 to 16.09%, respectively for the CS@PVP-ATC-SNPs1 and CS@PVP-RC-SNPs5, which confirm the significant contribution of SNPs in the reduction of moisture absorption. Indeed, SNPs could act as an interpenetrating network in the CS@PVP-ATC matrix and protect the prepared bio-nanocomposite films against moisture in the case of higher relative humidity.

Fig. 5
figure 5

Photographs of CS, CS@PVP, CS@PVP-ATC and CS@PVP-ATC-SNPs3 films after immersion in water

Fig. 6
figure 6

Moisture absorption of CS, CS@PVP, CS@PVP-ATC and CS@PVP-ATC-SNPs(1,2,3,4, 5%). bio-nanocomposites films

3.6 Water Contact Angle (WCA) and Water Vapor Permeability (WVP)

The contact angle measurement of CS, CS@PVP, CS@PVP-ATC and CS@PVP-ATC-SNPs(1,2,3,4 and 5%) bio-nanocomposites films was determined by measuring the wettability of their surface, the results are summarized in (Table 1) and displayed in Fig. 7. Contact angle value of 100° was obtained for CS film. This hydrophobicity of the chitosan surface layer has been attributed to their hydrophobic acetyl groups [51, 52]. This value was reduced to 92.3° for CS@PVP, indicating that the addition of PVP increases the hydrophilicity of the film surface due to the hydrophilic carboxylic and amino groups in PVP [44, 53, 54]. However, the WCA of the CS@PVP-ATC film was 89.1°, indicating that this film has hydrophilic behavior. Moreover, significant increase in WCA was observed after the addition of SNPs to the CS@PVP-ATC films, achieving 106.5°, 117.6° and 127.6° for the CS@PVP-ATC-SNPs1, CS@PVP-ATC-SNPs2 and CS@PVP-ATC-SNPs3 films, respectively. This increase may be attributes of greater hydrophobic properties of sulfur nanoparticles. In contrast, The WCA of CS@PVP-ATC-SNPs4, CS@PVP-ATC-SNPs5 decreased to 110.5° and 104.2°, respectively. This decrease can be due to the aggregation problem of the SNPs nanoparticles embedded in the CS@PVP matrix at a higher percentage [55].

Table 1 Transmittance, water vapor permeability, and water contact angle of chitosan-based films
Fig. 7
figure 7

Pictures of Water droplets on the surface bio-nanocomposite films: a CS, b CS@PVP, c CS@PVP-ATC, d CS@PVP-ATC-SNPs1, e CS@PVP-ATC-SNPs2, f CS@PVP-ATC-SNPs3, g CS@PVP-ATC-SNPs4 and h CS@PVP-ATC-SNPs5

The results of WVP of bio-nanocomposites films are also presented in (Table 1). The CS film showed a WVP rate of 4.43 × 10–9 (g/m/m2.Pa.h), while the CS@PVP film showed a WVP rate of 4.69 × 10–9 (g/m/m2.Pa.h). This can be explained by the fact that the addition of PVP modifies the structural organization of CS making the film less compact and therefore more permeable. The results show that the obtained WVP values are in the same range for similar polymer blends [13, 56, 57]. The WVP of the CS@PVP-ATC film was 4.70 × 10–9 (g/m/m2.Pa.h), which was slightly lowered by the incorporation of the sulfur nanoparticles. Indeed, it decreased as the percentage of SNPs increased. For the 1%, 2% and 3% CS@PVP-ATC-SNPs films, WVP decreased to 3.57 × 10–9 (gm/m2.Pa.h), 3.43 × 10–9 (gm/m2.Pa.h) and 2.68 × 10–9 (gm/m2.Pa.h) respectively, which was 1.4 times lower than the CS@PVP-ATC film. This decrease can be explained by the good dispersion of SNP, which prevents water vapor diffusion. However, the WVP value of CS@PVP-ATC-SNPs4 and CS@PVP-ATC-SNPs5 increased to 3.48 × 10–9 (g/m/m2.Pa.h) and 5.25 × 10–9 (g/m/m2.Pa.h), respectively. This increase can be explained by the agglomeration problem of SNPs in the matrix, which leads pushed the polymer chains away and increased water penetration.

3.7 Optical Analysis

The UV barrier properties is a crucial parameter that impact the effectiveness of packaging for food application through their ability to protect food products by selective filtration of different light waves. They also have an influence on the visibility and recognition of food products. Figure 8 shows the light transmission spectra, and (Table 1) shows the measured values of the films at 280 and 660 nm, respectively. The (T280) of the pure CS and CS@PVP film was 0.08% and 0.54%, respectively. Those values indicate that the CS and CS@PVP films had excellent UV barrier properties with absorbed value of 99% of the incident UV light radiation [58]. Moreover, the addition of ATC and SNPs does not affect the UV light barrier performance of the chitosan-based films. On the other hand, all films were able to protect against UV light, which can make them good candidates for the reduction of food spoilage that can be caused by UV light [59]. Regarding the transparency of the films (T660), the CS film was highly transparent with the (T660) equals 85.45%. This value increased up to 89.87% for the CS@PVP film, which may be due to the transparent nature of the PVP film [60]. After incorporation of the anthocyanin in the CS film, the (T660) decreased significantly due to the strong light absorption of the anthocyanins. The incorporation of SNPs into the CS@PVP-ATC film reduce the (T660) as the concentration of SNPs increase reaching a value of 69.64 to 28.61% for the CS@PVP-ATC-SNPs1 and CS@PVP-ATC-SNPs5 films, respectively. This decrease can be explained by the blockage of radiation caused by the nanoparticles.

Fig. 8
figure 8

Transmittance of CS, CS@PVP, CS@PVP-ATC and CS@PVP-ATC-SNPs(1,2,3,4, 5%). bio-nanocomposites films

3.8 Mechanical Properties

Mechanical properties are among the main criteria influencing the suitability of films for food packaging application [61]. These properties can be determined by measuring the elongation at break (EB), which is determined at the point of film fracture in tensile tests. The ultimate tensile strength (TS), the toughness (T), and the Young's modulus (YM), provides information on the flexibility and stiffness of the films. The mechanical behavior results of the prepared films are shown in the Fig. 9 and (Table 2). The tensile property of pure CS shows an EB of 4.39%, TS of 64.13 MPa, T of 184.98 J/m2, and a YM of 2.72 GPa. Due to its high molecular weight, CS is classified as a mechanically fragile material. The elasto-plastic behavior of the CS@PVP blend is different from that of CS, with a slight variation in tensile properties. The EB of CS@PVP showed a value of 16.14%, a TS of 58.93 MPa, a T of 714.65 J/m2, and a YM of 1.99 GPa. This indicates that this film is much more ductile than the CS film. The increase in the elongation at break is accompanied by an expected decrease in the tensile strength and Young's modulus. The increase of ductility is due to the fact that PVP has a lower intrinsic stiffness than the CS [45, 62]. The films blended with CS@PVP-ATC anthocyanins still show a plastic deformation with a remarkable decrease in elongation at break by 12.90%, tensile strength by 42.34 MPa, toughness by 344.90 J/m2, and Young's modulus by 0.57 MPa. These results are coherent with those reported in the literature where it is found that the addition of anthocyanin extracts to other biopolymer films affects their mechanical properties [9, 17, 19]. The incorporation of SNPs has slightly decreased the mechanical properties of CS@PVP-ATC film, in terms of Young's modulus and tensile strength. This decrease can be due to the low interactions between the polymer chains of the bio-nanocomposite films after the addition of SNPs, which generates a discontinuous phase of the film matrix preventing the mobility of the polymer chains. However, despite this reduction, the films are still strong enough to be used in food packaging [63, 64].

Fig. 9
figure 9

Stress–strain curves of CS, CS@PVP, CS@PVP-ATC and CS@PVP-ATC-SNPs(1,2,3,4, 5%) bio-nanocomposite films

Table 2 Mechanical properties of Chitosan-based films

3.9 Thermogravimetric Analysis (TGA)

The thermal behavior of the bio-nanocomposite films was assessed by thermogravimetric analysis using integral (TGA) and derivative (DTG) curves, the results are shown in Fig. 10a and b. The CS films thermogram indicate a first weight loss stage around 50 and 180 °C, attributed to the removal of physically adsorbed water. Subsequently, the weight losses observed at temperature value of 291 and 552 °C in the DTG curves Fig. 10b were associated to the degradation of the polysaccharide of the CS chain, and to the oxidative degradation of the carbon residue obtained from the second step of the CS, respectively. TGA analysis results of CS@PVP, CS@PVP-ATC and CS@PVP-ATC-SNPs (1,2,3,4,5) are similar and show four regions of weight loss. The first region between 50 and 180 °C is due to evaporation of weakly bound water. The second (200–354 °C) and fourth (480–590 °C) steps are due to the degradation of CS. The third step (354–480 °C) is related to the degradation of PVP [65]. It is worth noting that the thermal stability of the CS@PVP bio-nanocomposite films is improved compared to pure CS. Thus, it is clearly observed that ATC did not modify the thermal behavior of the CS@PVP film, and that the degradation of the CS@PVP-ATC-SNPs (1,2,3,4,5) bio-nanocomposite films was carried out in the order 5% > 4% > 3% > 2% > 1%. Thus, it can be concluded that the thermal stability increases slightly with increasing percentage of sulfur nanoparticles SNPs, which indicates that SNPs are thermostable and do not degrade completely in the tested temperature range [66].

Fig. 10
figure 10

a TGA and b DTG curves of CS, CS@PVP, CS@PVP-ATC and CS@PVP-ATC-SNPs(1,2,3,4, 5%) bio-nanocomposite films

3.10 Antibacterial Activity

The growth of foodborne pathogenic microorganisms inhibition ability of the bio-nanocomposite films was evaluated by studying their antimicrobial activity against Gram-positive (S. aureus) and Gram-negative (E. coli) bacteria, using the disk diffusion method. From the results shown in Fig. 11 and the (Table 3), it can be seen that the prepared films have some antimicrobial activity against both studied bacteria. In addition, the size of the inhibition zone varied with the type of used film, which suggests that chitosan, anthocyanin, and sulfur nanoparticles are effective antimicrobial agents. The antimicrobial activity of pure chitosan may be due to the presence of NH3+ cationic amino groups on their chain, which can interact with the cell membrane and change their permeability, causing their deformation and leading to the leakage of intracellular components, resulting in the final death of the cells [67]. Moreover, the presence of anthocyanins in the bio-composite films increases their ability to inhibit the growth of bacteria, which could be explained by the presence of phenolic structure in the anthocyanin molecules. On the other hand, the incorporation of SNPs revealed more strong antibacterial activity than the chitosan films and the ATC incorporated films, Although the zone of inhibition increased with the percentage of sulfur nanoparticles, which can be explained by the expected antibacterial effect of SNPs [68]. However, the antibacterial mechanism of sulfur nanoparticles remains unknown, among the proposed theories we note: (1) the disruption of metabolic processes caused by the contact of SNPs with biological cells [69]. (2) the decomposition of SNPs to produce sulfur ions and H2S, which responsible for the denaturation of proteins and lipids [70]. (3) the interaction of the sulfur nanoparticles with the DNA which prevents their replication, leading to its destruction and the death of the cell.

Fig. 11
figure 11

Antibacterial activity 1 CS, 2 CS@PVP, 3 CS@PVP-ATC, 4 CS@PVP-ATC-SNPs1, 5 CS@PVP-ATC-SNPs2, 6 CS@PVP-ATC-SNPs, 7 CS@PVP-ATC-SNPs4, 8 CS@PVP-ATC-SNPs5 bio-nanocomposite films. against S. aureus (Gram-positive) and E. coli (Gram-negative) bacteria

Table 3 Inhibition bacterial growth zone (according to the disk diffusion test) of Chitosan-based films. against S. aureus (Gram-positive) and E. coli (Gram-negative) bacteria

3.11 Antioxidant Activity

The DPPH has been widely applied to evaluate the antioxidant activity, the latter are microconstituents capable of scavenging free radicals by terminating oxidation reactions [71]. In addition, antioxidant activity is an important functions of potential packaging applications, as it helps to prevent the formation of bad taste and discoloration of packaged foods. The Fig. 12 shows the results of the DPPH radical scavenging activity of bio nanocomposite films and pure anthocyanin. These results showed that the CS@PVP film exhibited moderate antioxidant activity with a DPPH value of 17.87%, but the incorporation of anthocyanins into the CS@PVP-ATC film significantly increase the DPPH radical scavenging activity to 31.96%. However, the antioxidant activity of the films was not influenced by the incorporation of SNPs. The results suggested that the antioxidant activity of the bio-nanocomposite film was widely derived from anthocyanins with a DPPH scavenging value of 66.83%. The high antioxidant activity of ATC is associated to the presence of phenolic compounds capable to scavenging free radicals.

Fig. 12
figure 12

Antioxidant activity of ATC and CS@PVP, CS@PVP-ATC and CS@PVP-ATC-SNPs(1,2,3,4, 5%) bio-nanocomposite films determined by using DPPH methods

3.12 UV–Vis Spectroscopy Analysis of ATC Solutions

In order to verify the color change of anthocyanins on acidic and basic solutions, they were introduced into buffer solutions with pH ranging from 1 to 14. As shown in the Fig. 13, the ATC color change instantaneously from red, pink, purple, blue, green, and yellow respectively, for the pH intervals 1–2, 3–4, 5–6, 7–8, 9–10 and 11–14. The color change is based on structural modifications following a series of protonation/deprotonation reactions [16, 72]. The flavylium cations are the principal form at pH 1–3. The carbinol pseudo base is formed upon deprotonation and hydration at pH 4–5. In addition, the quinoid base is formed at pH 6–7. Then, the quinonoid bases are further deprotonated at pH 7–8 forming an anionic quinoid base and finally at pH > 8 the anthocyanin structure forms the chalcone. These observed structural and colorimetric changes are further confirmed by the variation of the optical properties using a UV–visible spectrophotometer. As seen in the absorption spectra in Fig. 13a, under very acidic conditions (pH < 4), the peak intensity at ~ 522 nm decrease as the pH increases. Moreover, the peak was shifted to higher frequencies (~ 556 nm) at pH 5 and 6. As the pH increase the adsorption peak at ~ 610 nm increase to reach their maximal value at pH 8, then decrease eventually at pH > 9.

Fig. 13
figure 13

a UV–Vis spectra b Chemical structure of ATC and c photographs of ATC solution under different pH values

A similar result was reported by I. Choi et al. [73] highlighting the ability of anthocyanin extracted from purple sweet potato to change color over a pH range from 2 to 10.

3.13 Color Response Analysis

The sensitivity of the films to the pH variation was investigated after immersing the films in solutions at different pH. The Fig. 14 shows the images of the films at varying pH and the (Table 4) shows the color parameters L*(luminance), a*(red-green) and b*(yellow-blue) for each film. According to these results, there is a visible color change when the pH varies from 2 to 6 after immersion for 5 min in hydrochloric acid solutions (1 M) and continues its color change when the pH varies from 8 to 12 after immersion in sodium hydroxide solutions (1 M). Initially, the film shows a red coloration with the parameter value a* = 56.93. By increasing the pH to 4, the film shows a pink coloration, and the value of the parameter a* decreases to 48.75. At pH 6, the coloration becomes purple with a decrease in the a* parameter and a value of 82.65 of the L* parameter, indicating the transparency of this film at pH 6. Furthermore, the presence of a blue coloration was indicated by the negative values of the parameter b* =  − 17.28 at pH equal to 8. This value increased to 11.86 at pH equal to 10 and decreased to − 37.5 for the parameter a* which indicates the presence of green coloration. Finally, at pH 12, the presence of a yellow coloration is indicated with a maximum value of the parameter b* = 77.93.

Fig. 14
figure 14

Color variations of colorimetric pH indicator films immersed in different pH solutions (2.0–12.0)

Table 4 Color parameters (L*, a*, b*, ΔE) of CS@PVP-ATC-SNPs3 under different pH solutions

3.14 Food Packaging Test

Meat products have known for their important nutrient composition. However, the microbial contamination resulting from the oxidation of lipids and proteins accelerate it deterioration. Meat quality and safety criteria remain very dependent on packaging materials and technologies. For these reasons, monitoring meat spoilage and monitoring film color changes as a function of pH were performed, and the results are shown in Figs. 15 and 16. The pH values of the control samples during the six days of storage are 5.69, 5.98, 6.48, 6.83, 7.34, 7.81 and 7.92. This increase is due to the degradation of meat proteins and the release of amino acids due to the formation of bacteria which leads to the liberation of volatile compounds such as ammonia and trimethylamine [74]. For the meat samples packaged with the CS@PVP-ATC film, the pH values of about 5.69, 5.76, 5.98, 6.19, 6.34, 6.64 and 7.32 during the six days of storage respectively. This increase was detected by the CS@PVP-ATC film through a visual change in coloration as a result of the accumulation of alkaline gases at the free zone of the box. At the beginning of the experiment (D 0) the film had a purple color (∆E= 0, reference sample), and the meat was still fresh. But after two days of storage, a clear color change was observed (∆E= 10.52), indicating the initiation of meat deterioration. This color became darker on the sixth day and turned bluish gray (∆E= 25.3) accompanied by a complete deterioration of the meat (pH 7.32). The meat samples packed with CS@PVP-ATC-SNPs3 film shows pH values of 5.69, 5.70, 5.74, 5.80, 5.98, 6.02 and 6.1, respectively, during the six days of storage. From these results and the images shown in the (Fig. 16), it can be seen that no color change was observed during the first 4 days (∆E < 2.36), and the meat samples still remain of good quality. In addition, the shelf life was extended by 4 days in comparison with the samples packed with CS@PVP-ATC film. This may be due to the activation effect of SNPs as an antibacterial agent causing the hydrolysis of meat proteins [42, 68]. These results corroborate with the work published by [72], who used a anthocyanin loaded-chitosan nanofiber/methyl cellulose matrices as an indicator to monitor the freshness of the meat, and they reported that the color of the films changed from purple to green/gray during storage, which may be due to the elevation of pH from 5.7 up to 7.3 during 3 days. Thus, from the results obtained in our studies, we were able to design a bio-nanocomposite film capable not only of detecting the end of food spoilage, but also of extending its shelf life.

Fig. 15
figure 15

The pH variation of meat and the corresponding change of ΔE of the indicator during storage

Fig. 16
figure 16

Application color indicator film for monitoring spoilage of meat

4 Conclusion

In this work a dual function packaging film was successfully synthesized via solution-cast method. By the recombination of chitosan-PVP bio-nano-composite matrix, anthocyanin as the smart substance and sulfur nanoparticles which have the active function. The characterization results showed that the incorporation of SNPs into the bio-nano-composite films improves their thermal properties, increases their hydrophobicity by 38°, evolves their water vapor barrier power, water and moisture resistance, and UV protection. In addition, the bio-nano-composite films have shown exceptional antibacterial activity towards E. coli and S. aureus as one of the most important properties for a food packaging material. The antioxidant activity from the anthocyanins is still present in the CS/PVP-ATC matrix. In addition, a remarkable color change was visualized after immersion of the films in pH solutions ranging from 2 to 12. Taken together, these results confirm that SNPs and anthocyanins incorporated in Chitosan-PVP films could be used as active and smart contact materials to protect and monitor the freshness of food products during storage or transportation, which could be beneficial for waste reduction and make food processing more sustainable.