Introduction

Food spoilage is usually detailed as chemical and then organoleptic changes, impacting notably product quality and safety, leading to unsatisfactory output for consumption. Among diverse transformations during storage, pH variation is one of the prominent considerations in identifying spoilage status [1]. For example, the changes in pH value of fresh pork (5.84), beef (5.8), and lamb (5.8) compared to spoiled ones (6.67, 6.71, and 7.0–7.5, respectively) were recorded in previous literatures [2,3,4]. Some conventional approaches to identify food spoilage include sensory evaluation, chemical analyses, and microbiological assays. These techniques are usually conducted by experts, which are time-intensive and costly. Thus, an orientation in the food industry is to develop intelligent films as real-time product quality and safety informants through their capacity for visual color changes [5, 6]. Besides main film matrix materials, these products usually comprise pH-based colorimetric indicators, such as synthetic dyes or natural colorants like anthocyanin.

Anthocyanin is a water-soluble subgroup of flavonoids that is accountable for the purple, red, and blue pigmentation in diverse plant-originated products. These compounds also express antioxidant activities, which are believed to safeguard against type 2 diabetes, inflammation, cardiovascular diseases, and the risk of certain cancers [7]. Besides health benefits, anthocyanin can also modify its color depending upon the pH of the aqueous environment, allowing them to act as a functional agent in smart packaging [8]. These color variations of anthocyanin in alkaline or acidic conditions mostly rely on its structural alterations [9].

Among diverse plants, roselle and mulberry are two abundant sources of anthocyanin, and their extracts are currently employed as a natural pH sensor for the development of intelligent films. Roselle (Hibiscus sabdariffa L.) is an herb found in tropical and sub-tropical area like India and Southeast Asia [10]. Its calyces are recognized as a source of anthocyanin, including glucoside and sambubioside derivatives of delphinidin and cyanidin [11]. Anthocyanin from roselle was applied to formulate intelligent starch/chitosan/poly(vinyl alcohol) films to monitor pork freshness [12]. On the other hand, the compositions of anthocyanin in mulberry (Morus alba L.) are commonly the glucoside and rutinoside derivatives of cyanidin and pelargonidin [13]. Additionally, acetylated derivatives of these anthocyanins are also detected [14]. Similar to roselle, anthocyanin from mulberry was also employed to incorporate with films prepared from chitosan/poly(vinyl alcohol) [15], gelatin/poly(vinyl alcohol) [16], k-carrageenan [14] to develop intelligent films.

Previous literatures affirmed that acylated anthocyanins are much more stable than monomeric anthocyanins due to their ability in intra- and inter-molecular co-pigmentation [17, 18]. This indicated that the former is less sensitive to pH fluctuation, producing a paler color response [19]. Hence, the chitosan-based films incorporated with anthocyanin from roselle are expected to be more sensitive to pH value than those containing mulberry extract. However, the comprehensive comparison between the pH-responsive properties of films containing anthocyanin from roselle or mulberry was not reported. Therefore, in this research, anthocyanins extracted from roselle (Hibiscus sabdariffa) and mulberry (Morus alba L.) will be characterized, and then added to chitosan solution at diverse concentrations (0.3, 0.6, and 0.9 mg anthocyanin/g chitosan) to formulate the functional biodegradable films. Among various common renewable polymers employed to fabricate biodegradable films such as gelatin [20] or starch [21], chitosan was used in this study due to its low cost and abundance [22]. Additionally, the structural, morphological, physical, mechanical, and functional characterizations of these achieved packaging materials will be benchmarked and compared.

Materials and methods

Materials

Dried roselle and fresh mulberry were purchased from Nhien Farm, Lam Dong province, Vietnam. Chitosan was brought from a local company in Ninh Thuan province, Vietnam. All chemicals and reagents used were obtained from Sigma-Aldrich or Merck.

Anthocyanin extraction from roselle and mulberry

The extraction of anthocyanin from roselle and mulberry was carried out according to the procedure of [23] with modification. Screening experiments were first conducted to clarify the appropriate extracted weight for each kind of plant sample. Dried roselle (~ 10 g) and fresh mulberry (~ 50 g) were individually prepared, mixed with 100 mL of 70% ethanol solution, and incubated at 5 °C for 24 h. Afterwards, centrifugation was performed at 3000 rpm for 6 min, and ethanol from the supernatant was then removed using a rotary evaporator at 50 °C. Subsequently, the solutions of roselle and mulberry with a volume concentrated of 77% and 60%, respectively, compared to the initial volume, were achieved. The extracts were considered as “anthocyanin-rich concentrated extracts” from roselle (RARE) and mulberry (MARE), put in sealed dark bottles, and stored at -20 °C for further analyses and usage.

Characterization of anthocyanin-rich concentrated extract from roselle and mulberry

The anthocyanin content of RARE and MARE was determined based on the method of [24]. The anthocyanin content was expressed as mg cyanidin-3-O-glucoside equivalent (C3G) per g dried weight (dw).

Thermal degradation kinetics of RARE and MARE were investigated according to the modified procedure of [25]. The extracts (10 mL) were prepared in a dark screw-cap bottle and then placed in a thermostatic incubator at 25, 40, and 55 °C. Heated samples were taken from the water bath at various time intervals (1, 2, 3, 4, 5, 24, 29, and 48 h) and promptly cooled in an ice bath. Afterwards, the anthocyanin content of these samples was measured directly. First-order kinetics was used to describe the anthocyanin degradation as (Eq. 1) and (Eq. 2).

$${C}_{t}={C}_{o}\text{exp}(kt)$$
(1)
$${t}_{1/2}=-ln0.5/k$$
(2)

where Ct and Co are the anthocyanin contents at the beginning and after time t, k is the rate constant and t1/2 is the half-life.

The pH-responsive property of RARE and MARE was analyzed through the modified approach of [26] with the buffers of diverse pH values (2.0–12.0). The extracts (1 mL) were dissolved in 5 mL of prepared buffer solutions. Subsequently, the obtained mixtures were photographed using a smartphone camera, while their absorbances were measured using a colorimeter (CR-400 Chroma, Japan).

Antioxidant activities of RARE and MARE were analyzed by DPPH (2, 2-diphenyl-1-picrylhydrazyl) radical scavenging activity assay according to a modified method of [27] and expressed in mg Trolox equivalents (TE)/g dry weight.

Development of the composite films

To prepare the films, chitosan powder was initially dissolved into aqueous acetic acid (1.5%, v/v) to obtain a solution (1%, v/v), and glycerol (30% w/w) was subsequently added as a plasticizer. After stirring at 60 oC for 30 min and centrifuging at 4000 rpm for 10 min, the clear solution was added with the diversified amounts of RARE or MARE (0.3, 0.6, and 0.9 mg anthocyanin/g chitosan). Afterwards, biodegradable films were casted by pouring 151 g of the whole mixed suspension into a 180-mm-diameter mold, then dried at 40 °C in the oven overnight. Finally, the dried films were detached from the mold and stored in a dark desiccator at 25 °C for further analyses. Before each experiment, the films were usually reconditioned in a chamber containing saturated Mg(NO3)2 solution (~ 50% relative humidity) at room temperature for 48 h [19, 28, 29]. The chitosan-based films without RARE or MARE were utilized as the control and labelled CS. R3, R6, and R9 were noted for the films made from chitosan solution containing RARE at the concentrations of 0.3, 0.6, and 0.9 mg anthocyanin/g chitosan, respectively, whereas M3, M6, and M9 were abbreviated for the films made from chitosan solution containing MARE at the concentrations of 0.3, 0.6, and 0.9 mg anthocyanin/g chitosan, respectively.

Structural and morphological characterization of the composite films

Scanning electron microscopy inspected the cross-sectional morphology of the composite films with an accelerating voltage of 10 kV. Their chemical structures were examined by using Fourier transform infrared spectrometer (FTIR) (FT/IR-4700, Jasco, Japan) with a resolution of 1 cm−1.

Physical properties of the composite films

Film thickness was analyzed by a digital micrometer (547-400S, Mitutoyo, Japan) with a precision of 1.00 µm. Ten randomly selected positions on each film were measured, and then the mean values were calculated and reported in µm.

Optical properties, including color parameters and light transmittance of the composite films, were determined using methods reported by [30]. A UV–Vis spectrophotometer (UVD-3500, USA) was employed to measure the light transmittance of the composite films by scanning the samples at 300–800 nm. Additionally, a colorimeter (CR-400 Chroma, Japan) was utilized to estimate the color parameters of the composite films, including L (black to white), a (green to red) and b (blue to yellow) values.

The standard approach (ASTM E96) was applied to qualify the water vapor permeability (WVP) of the films [31]. Cups with silica gel (0% relative humidity) were first covered with reconditioned films, then weighed and put in a box of saturated NaCl solution (75% relative humidity) at room temperature. The weight change of the cup was recorded hourly using a 4-digital analytical balance for 8 h. Finally, all data of recorded weight was plotted with time, and subsequently, its slope presenting the rate of water diffusion during the steady state was determined. The water vapor transmission rate (WVTR, mgh−1 m−2) was computed as a ratio of slope (mgh−1) to investigated area (m2), while WVP was estimated by Eq. 3.

$$WVP \left(g{m}^{-1}{s}^{-1}{Pa}^{-1}\right)=WVTR\times \frac{x}{\Delta p}$$
(3)

where x is the film thickness (mm), and ∆p is the difference in partial water vapor pressure.

To examine the swelling ratio of films, they were cut into 2 × 2 cm, weighed and submerged in water at room temperature for 30 min. The swelling ratio was calculated by the ratio between the increased weight after submerging and the initial weight of the dry film.

Mechanical and functional properties of the composite films

Tensile strength (TS) and elongation at break (EB) of films were measured following the standard procedure (ASTM D882) [31]. The film strips of 7 × 55 mm were mounted between the grips of the instron, and then operated with an initial grip separation of 45 mm and a crosshead speed of 0.5 mms−1. Both TS and EB were estimated by Eqs. 4 and 5, respectively.

$$TS \left(MPa\right)=\frac{{F}_{max}}{A}$$
(4)
$$EB \left(\%\right)=\frac{\Delta l}{{l}_{0}}\times 100$$
(5)

where Fmax and A are the maximum load and initial cross-sectional area, respectively, while ∆l and lo were the increased length after breakage and initial length, respectively.

The pH-responsive property of composite films was observed using the method of [29]. The film sample was immersed in different buffer solutions (pH 2–12) for 10 min. Subsequently, the color change of the film was photographed by a smartphone camera. Antioxidant activity of the composite film was measured by using DPPH radical scavenging assay through the technique described by [32].

The ammonia-sensitive characteristic of composite films was tested according to the method of Qin et al. [33]. In this process, a film sample was placed in the headspace of a Petri dish containing 20 mL of ammonia solution (3 mol/L). A smartphone camera (iPhone 11, Apple Inc., Cupertino, CA, USA) recorded the progressive color changes in the film for an hour. The test was carried out at 25 °C.

Statistical analysis

At least triplicate measurements were performed. The mean of triplicate measurements was expressed and statistically analyzed by one-way ANOVA or t-test using Minitab (software version 21, Minitab, USA) at 95% confidence level.

Results and discussions

Characterization of anthocyanin-rich concentrated extract from roselle and mulberry

RARE and MARE were characterized by their total anthocyanin content and antioxidant capacity (Table 1). The total anthocyanin content of RARE was 2.12 mg C3G/g dw, which was much lower than that in MARE (27.43 mg C3G/g dw). This result led to higher antioxidant activity of MARE (59.40 mg TE/g dw) than that of RARE (22.62 mg TE/g dw). The data of the latter was agreeable with previous research done on the antioxidant capacity of roselle calyx extract [34]; while [35] confirmed that the antioxidant capacity of mulberry ranged from 5.85 to 40.73 mg TE/g dry weight.

Table 1 Anthocyanin content and DPPH scavenging activity of anthocyanin-rich extract

Table 2 illustrates the thermal stability of anthocyanins from RARE and MARE through their parameters of the first-order kinetic model [36, 37]. All coefficients of determination were nearly to 1, indicating the good fitting. The results indicate that anthocyanin could degrade at high temperatures with higher rate constants and shorter half-life. Additionally, comparison between two sources of anthocyanin displays that MARE was more susceptible than RARE, along with rising temperatures. The difference in susceptibility to temperature might be due to their varying sugar substitutions [25].

Table 2 Effect of temperature on the rate constant and half-life values for anthocyanin degradation

Figure 1 presents the pH-responsive property of anthocyanin from RARE and MARE. Both of them shared a similar color-changing behavior, such as red to reddish-pink at pH 2–4, pink at 5–6, purple at pH 7–10, and green-yellow at pH 12. However, the color intensity of RARE was stronger. This pattern was also reported in previous observations [38, 39]. The variation in color of RARE and MARE at diverse buffer solutions could be explained by the structural change of anthocyanin from flavylium cation (red) to quinoidal anhydrobase (purple), and then chalcone (yellow-green) along with rising pH values [9, 39]. These results indicate that both RARE and MARE could be employed to formulate composite films whose purpose is expected to be used as an indicator for meat spoilage through their pH-responsive properties. Previous literatures affirmed that fresh red meat has a pH of around 5, while the spoiled one claims a pH of 7.0–7.5 [2,3,4]. Hence, the pH-responsive properties of RARE and MARE at various concentrations were tested at pH from 5 to 7. Generally, anthocyanin from roselle and mulberry witnessed the same tone of color with respect to the pH values, but RARE was more sensitive than MARE. Particularly, concerning the rising pH value from 5 to 7, RARE was able to perform the visual shift of color at a low concentration of 0.06 mg anthocyanin/g RARE, while the significant color change of MARE could only be observed clearly at a higher concentration (0.14 mg anthocyanin/g MARE). The difference in pH-responsive ability between RARE and MARE could be explained by their compositions of anthocyanins [39]. MARE was declared to consist of acylated anthocyanin, such as cyanidin-3-O-(6-acetyl)-glucoside, pelargonidin-3-O-(6-acetyl)-glucoside, malvidin-3-O-(6-acetyl)-glucoside [14], while acylated structures were not detected in RARE [11]. Acylated anthocyanins manifested great stability owing to their ability in intramolecular copigmentation [18]. Liu et al. [40] also revealed that the steric hindrance of acyl prevented the formation of chalcone, improving the stability of anthocyanin. Hence, MARE was more stable than RARE and displayed lighter color intensity.

Fig. 1
figure 1

The color changes of anthocyanin of RARE and MARE in diverse pH-adjusted buffer solutions (Color figure online)

Morphology and color attributes of composite films

Table 3 describes the color attributes of chitosan-based films incorporated with RARE or MARE. CS was pale yellow, which corresponded to its L, a, and b values presented in Table 3. The addition of anthocyanins rendered composite films darker and shifted to red–purple color, reflected by the increment of a parameter and the decline of L and b. Similar findings were observed in polymeric films prepared from poly(vinyl alcohol)/chitosan nanoparticles/mulberry extract films [15]. Regarding composite films, M3 had the highest L value (64.45) and lowest values of a (− 1.13) and b (5.41), leading to the brightest and most transparent appearance. This distinction could be clarified by the greater thermal susceptibility of MARE as compared to that of RARE (Table 1). Thus, R3 had a higher amount of color pigment than M3 after the film-drying process, even though the additional level of anthocyanin was initially equal (0.3 mg anthocyanin/g chitosan). Concerning the higher amounts of incorporated anthocyanins (0.6 and 0.9 mg anthocyanin/g chitosan), MARE produced the films with higher a value than RARE, while there were no considerable differences in the b value. This result corresponded to the red–purple pigments that existed on the appearances of M6 and M9. A suitable explanation could be due to the difference in anthocyanin composition between RARE and MARE [32].

Table 3 Color attributes of composite films prepared from chitosan and anthocyanin from roselle or mulberry

The cross-sectional morphologies of composite films are exhibited in Fig. 2. CS had smooth and homogenous structure, implying the fine compatibility between chitosan and glycerol. When a low anthocyanin content (0.3 mg/g) was incorporated into the film, both M3 and R3 displayed a smooth appearance but had a compact structure compared to CS, indicating that low amounts of RARE and MARE were well distributed in the film matrix [29]. However, their higher additional levels (0.6 and 0.9 mg anthocyanin/g chitosan) made the façade of composite films rougher. These findings were agreeable with previous studies on the films incorporated with anthocyanin extracts from Hibicus [41] or black eggplant [29]. The agglomeration of the extracts may be the reason for the decrease in homogeneity of the film matrix [42].

Fig. 2
figure 2

Cross-sectional scanning electron micrograph of composite films prepared from chitosan and anthocyanin of RARE and MARE

Light transmittance of composite films

Food is commonly oxidized owing to exposure to the UV–Vis light, resulting in the deterioration of food quality, such as discoloration, nutrition loss, and off-flavor [43]. Thus, the capacity of the UV–Vis light barrier, which negatively correlates with the percentage of light transmittance, is one of the required properties for food packaging films. Figure 3 illustrates the light transmittance (300–800 nm) of composite films formulated from chitosan and anthocyanins of RARE and MARE. CS almost had the highest UV–Vis light transmittance at all tested domains of wavelength due to the lack of UV-absorbing chromophores [33]. Furthermore, the light transmittance of composite films significantly reduced along with rising amounts of anthocyanins added to the film. This reduction was consistent with previous observations on chitosan-based films incorporated with anthocyanins from eggplant [29]. The potent UV-light barrier capacity of composite films could be explained by the abundance of aromatic rings in the anthocyanin structure, which was able to absorb UV–vis radiation [44].

Fig. 3
figure 3

Light transmittance of composite films prepared from chitosan and anthocyanin of RARE and MARE

Chemical structures of composite films

FTIR spectra of chitosan-based films containing RARE or MARE are displayed in Fig. 4. The spectrum of CS exhibited some representative bands at 3292 cm−1 (O–H and N–H stretching), 1612 cm−1 (C=O stretching), 1526 cm−1 (N–H bending, amide II), and 1015 cm−1 (C–O sketching), which was consistent with previous observations [28, 29, 32]. The incorporation of anthocyanins from roselle and mulberry into chitosan did not induce any noticeable changes in the FTIR spectra of composite films. Previous observations revealed that the FTIR spectrum of anthocyanins also illustrated some representative bands at 3342 cm−1 (phenol O–H group), 1636 cm−1 (C=C group), and 1026 cm−1 (C–O sketching and stretching vibration of C–O–C ester) [45, 46]. These characteristics bands of anthocyanins were similar to those of CS, leading to no new peaks observed in the anthocyanin-incorporated films. However, the peak intensities were altered and their band positions shifted slightly. In particular, the band of O–H or N–H stretching was broadened and shifted from 3292 to 3301–3380 cm−1. Meanwhile, the band of amide II increased and shifted from 1526 to 1528–1536 cm−1, which was agreeable with the preceding research [30]. The variations in the band position and peak intensity verified the intermolecular interactions such as hydrogen bonds between chitosan and extracts [30, 32, 47].

Fig. 4
figure 4

FTIR spectra of composite films prepared from chitosan and anthocyanin of RARE and MARE

Physical properties of composite films

Thickness is a decisive parameter for food packaging films owing to its direct influence on WVP, light transmission, and mechanical properties [19]. Table 4 presents the thickness of composite films. Generally, the thickness of CS and composite films varied insignificantly, which ranged from 74.90 to 88.35 µm. This indicated that the addition of RARE or MARE in chitosan did not alter the film thickness. The thickness of films is commonly influenced by the utilized proportions of the film-forming solution for each manipulation [48] as well as the casting procedure [49]. Furthermore, each component in the film matrix as well as the interaction among them also contribute to the variation of film thickness [48, 50]. In this study, these mentioned factors were controlled similarly among samples, except the incorporated content of anthocyanins. However, the used anthocyanin amounts (from 0.3–0.9 mg/g chitosan) were minor as compared to the chitosan weight, resulting in no significant variation in the thickness among films.

Table 4 Physical and mechanical properties of composite films prepared from chitosan and anthocyanin from roselle or mulberry

Water vapor permeability (WVP) of films is one of the vital determiners for the shelf-life of products in the food packaging industry [26], described in Table 4. CS had the highest WVP (9.46 × 10–11 gm−1 s−1 Pa−1) among all composite films. The incorporation of anthocyanins into chitosan substantially reduced the WVP of composite films. WVP also significantly diminished along with rising added contents of anthocyanins. Additionally, at the same levels of anthocyanins, there were no considerable differences between the impacts of RARE and MARE on WVP. The result was consistent with previous studies on chitosan-based films incorporated with anthocyanins from blueberry and blackberry [8] or black soybean seed [30], or colorimetric films from k-carrageenan and the extract from Lycium ruthenicum Murr. [14]. The reduction in WVP could be explained by the intermolecular interactions between chitosan and polyphenolic compounds like anthocyanins, decreasing the hydrophilicity of the film matrix, and hence its affinity toward water vapor [51]. Previous literature also confirmed that the steric aromatic and pyrylium rings in the skeletal structure of anthocyanins could obstruct the inner network of the films, and then reduce water vapor permeation [39]. Furthermore, the incorporation of anthocyanins could also decrease the water vapor diffusion rate via lowering the free volume of the matrix and prolonging the access of water vapor [28, 29].

Table 4 also demonstrates the swelling degree of films. Generally, all composite films had higher swelling degrees than CS, except R9. However, the swelling degree of composite films decreased along with the rising level of anthocyanins. At the same contents of anthocyanins, MARE positively impacted the swelling degree of composite films as compared to RARE. These results could be pointed out due to the interactions between chitosan and anthocyanins. Particularly, these interactions could alter the cross-linking degree in the intermolecular chain of chitosan, reducing retractive force and allowing more water to be absorbed [52]. Nevertheless, when the higher dosages of anthocyanins were used, the cross-linking grids formed by chitosan and anthocyanins via hydrogen bonding favorably induced, obstructing the process of water molecule transfer into films, resulting in a decline in the water absorptivity [53].

Mechanical properties of composite films

Mechanical properties indicate the ability of packaging films to retain good integrity and flexibility against external stress [54]. They are displayed in Table 4 as tensile strength (TS) and elongation at break (EB). The incorporation of RARE or MARE into chitosan at appropriate contents (0.3 and 0.6 mg/g) significantly improved the TS of composite films. The enhancement in TS could be clarified by the increased hydrogen bonds between hydroxyl/amino groups of chitosan and hydroxyl groups in anthocyanins, strengthening the interfacial adhesion of these film components [12, 29]. Furthermore, the excessive addition of anthocyanins (0.9 mg/g) considerably reduced the TS of composite films. A similar observation was also recorded on the chitosan-based films incorporated with anthocyanins from purple and black rice [32]. This decline was probably due to the agglomeration formed by the high concentrations of extracts, leading to the interruption of interaction between chitosan and anthocyanins [55].

On the other hand, the incorporation of RARE or MARE significantly enhanced the EB of composite films. This improvement in EB could be due to the possible plasticizing effect of the extracts that had diffused into the film network [56]. Moreover, when the added anthocyanin contents were equal, the EB of chitosan-based films incorporated with RARE was considerably higher than that of composite films containing MARE. This might be because MARE manifested a more anti-plasticizing effect, limiting the motion of polymer chains and reducing film flexibility [39].

Antioxidant capacity of composite films

Figure 5 exhibits the antioxidant activity of composite films prepared from chitosan and anthocyanins from RARE or MARE. CS displayed a moderate DPPH radical scavenging ability (126.4 µg TE/g film) since it lacked hydrogen atoms that could be readily donated as an efficient antioxidant [57]. Previous study revealed that anthocyanins performed an effective free radical scavenging capacity because its multiple phenolic hydroxyl groups could easily donate hydrogen atoms [58]. Thus, anthocyanins from both RARE and MARE notably boosted the antioxidant activity of composite films. Moreover, the activity considerably intensified along with the increasing content of anthocyanins. These findings were consistent with the work done by Zhang at el (2019) [12], affirming that the addition of anthocyanins from RARE remarkably improved the antioxidant activity of polyvinyl alcohol/chitosan films. Liu et al. [14] also revealed that the DPPH radical scavenging ability of k-carrageenan films improved with the incorporation of anthocyanin-rich mulberry extracts. Regarding the same added levels of anthocyanins, chitosan-based films containing RARE showed higher antioxidant activities than those of MARE, except for the content of 0.3 mg anthocyanin/g chitosan. The difference in impacts of RARE and MARE on antioxidant activity could be explained by their heat tolerant ability, composition, and structure. MARE was proved to be more thermal-susceptible than RARE at a certain temperature (Table 2). In addition, RARE contained cyanidin-3-sambubioside and cyanidin-3-glucoside, which performed more antioxidant potentials compared to cyanidin-3-O-glucoside and cyanidin-3-O-rutinoside existing in MARE [59, 60].

Fig. 5
figure 5

Antioxidant activity of composite films prepared from chitosan and anthocyanin of RARE and MARE

pH-sensitive properties of composite films

The pH-sensitive properties of composite films prepared from chitosan and anthocyanins from RARE or MARE are presented in Fig. 6. Generally, chitosan-based films incorporated with RARE or MARE shared a similar color change pattern of anthocyanin extracted from corresponding sources with respect to the pH value, except pH 2. Regarding pH 2, a blue-purple color was observed in composite films instead of the reddish-pink of RARE or MARE. The variation in the color change between RARE or MARE and products containing them with respect to pH value could be explained by the different mechanisms between aqueous (extracts) and solid (films) systems. Additionally, when the same levels of anthocyanins were exploited, RARE could make composite films darker than MARE, which agreed with Fig. 2. However, a low anthocyanin content added into chitosan solution (0.3 mg/g) did not induce evident changes in the color tone of composite films towards pH values from 3 to 12, except for the green-yellow of products containing RARE at pH 12. On the other hand, concerning the employment of higher anthocyanin levels (0.6 and 0.9 mg/g), the composite films exhibited obvious shifts from reddish-pink in acidic conditions to dark yellow in basic ones. Moreover, at too-low (3 and 4) and too-high (10–12) pH values, films containing RARE demonstrated more apparent development in color than ones consisting of MARE. This change was consistent with the previous result showed in Fig. 1 and could be clarified by the greater stability of the acylated anthocyanin in MARE [18] and the steric hindrance of acyl in preventing the formation of chalcone [40].

Fig. 6
figure 6

Color changes of composite films prepared from chitosan and anthocyanin of RARE and MARE after being steeped in pH-adjusted buffers for 15 min (Color figure online)

Ammonia-sensitive characteristic of composite films

The color sensitivity of composite films towards the vapor of ammonia was employed to mimic the color change of films during the storage of protein-rich food, where its spoilage produce volatile alkaline nitrogenous compounds. The ammonia-sensitive characteristic is originated from the mechanism that ammonia vapor disperses into the film, dissociates in the polymer matrix to construct hydroxyl ions, and consequently tailors the matrix alkaline [12]. Under basic conditions, the purple of anthocyanins could transform into the yellow of chalcone [9]. Figure 7 describes the color changes of composite films after being exposed to ammonia for an hour. Generally, chitosan-based films incorporated with RARE or MARE shared a similar color change pattern with respect to the exposure time to ammonia, where the final color was yellowish after an hour. However, the color tone and change rate may vary, depending on the anthocyanin sources and their contents. A real-time test on the basa fish storage was conducted to confirm the color change. Figure S1 in Supplementary Material illustrates a similar color variation pattern of the films, where the film colors after 24-h fish storage were equivalent to those of the films exposed to ammonia for 20 min. Among the color alteration, the shift from dark red–purple to brighter gray-purple of the M9 film from 0 to 24 h was the most visible, which could be easily recognized by naked eyes. Further investigations and simulations are required to determine the effective film area per product weight, the volume of headspace as well as the correlation of the film color with the level of product spoilage and storage duration to provide a color pattern guideline for the indication of product freshness.

Fig. 7
figure 7

Color changes of composite films prepared from chitosan and anthocyanin of RARE and MARE after being exposed to ammonia for a period of time (Color figure online)

Conclusion

The intelligent films were successfully progressed by incorporating anthocyanin from RARE or MARE into the chitosan matrix. All achieved films exhibited a darker color and a rougher cross-sectional appearance than ones without anthocyanins. When anthocyanins were incorporated into chitosan-based films, no significant differences in FTIR spectra and thickness of these films were noticed. Nevertheless, the chitosan-based films containing anthocyanins had a higher swelling degree, mechanical properties, and antioxidant activity but lower light transmittance and water vapor permeability than those without anthocyanins. Furthermore, these products changed their color regarding pH value, from red to reddish-pink at pH 3–4, pink at 5–6, purple at pH 7–10, and green-yellow at pH 12. Although mulberry contained more anthocyanins than roselle, the roselle anthocyanins were more stable with elevated temperatures and hence rendered the resultant films with higher antioxidant capacity. Both of anthocyanin sources had high sensitivity toward ammonia and fish spoilage. However, the tone of color change with MARE may be more visible. Further investigations and simulations are needed to provide a color pattern guideline to indicate the levels of various product spoilage.