Introduction

The common barberry (Berberis vulgaris) naturally grows in the forests of Europe, Northern Turkey, the Caucasus, and certain regions of Iran, including Azerbaijan, Guilan, Mazandaran, and Khorasan1.

The seedless B. vulgaris, widely cultivated in Iran, is a rich source of anthocyanins used as natural food colorants. These anthocyanins are extensively utilized in the food and pharmaceutical industries due to their strong antioxidant and anti-inflammatory properties2.

Like other polyphenols, anthocyanins act as free radical scavengers. The pH of their environment significantly influences their structure and antioxidant activity. Under acidic conditions, anthocyanins predominantly exist as the flavylium cation, a chemically stable form3. This flavylium structure allows for radical electron delocalization over the sp² orbitals of the oxonium moiety4. The antioxidant activity of anthocyanins mainly arises from the oxidation of their phenolic hydroxyl groups, particularly the para and ortho hydroxyl groups, which are essential for the formation and stabilization of semiquinone and one-electron oxidation products5,6,7. However, anthocyanins are inherently unstable under environmental stress. Their stability is significantly affected by pH and temperature: they are more stable in acidic conditions but degrade as pH and temperature increase, resulting in a loss of color and antioxidant capacity. This instability poses challenges for their application in the food industry8.

The most effective way to address these issues is by utilizing encapsulation systems to protect bioactive compounds and enhance their efficacy9,10. Encapsulation surrounds these compounds with a protective polymeric coating, shielding them from harmful environmental factors. This strategy not only improves the stability and bioavailability of the active compounds but also facilitates controlled release at targeted sites, thereby enhancing their functionality10. Furthermore, encapsulation eliminates the need for toxic solvents during extraction and protects active compounds from degradation and adverse interactions with other food components11.

One of the most effective preservation techniques for sensitive compounds, such as anthocyanins, is freeze-drying. This method employs low temperatures to prevent thermal degradation during processing, thus maintaining the antioxidant activity and color stability of anthocyanins more effectively than conventional drying methods12.

Casein, a protein derived from milk, shows promise as a wall material for encapsulation due to its ability to interact with both hydrophobic and hydrophilic molecules. Its high proline content and relatively hydrophobic nature make it an excellent carrier for bioactive compounds. These interactions result in the formation of compact and stable capsule structures, significantly enhancing the physical and chemical stability of sensitive compounds such as anthocyanins13,14.

Encapsulation can greatly improve the oxidative stability of oils by creating a protective barrier that limits their exposure to oxygen. However, some encapsulation techniques may present drawbacks that undermine their effectiveness. For instance, certain systems can hinder the release of active compounds, such as antioxidants, into the oil15. Additionally, methods like spray drying can promote oxidation and degradation of heat-sensitive components16. In emulsion-based encapsulation, improper formulation or instability can lead to phase separation, resulting in oil oxidation or uneven release of active substances17.

To address these limitations and considering the well-documented antioxidant properties of B. vulgaris extract, as well as the potential of casein as a protective biopolymer, we optimized the preparation of casein-based capsules at various pH levels. We evaluated the antioxidant activity, release profile, and structural characteristics of the capsules using FTIR and FESEM analyses. Furthermore, this study investigates, for the first time, the effects of both casein-encapsulated and free anthocyanin extract of B. vulgaris on the antioxidant activity and oxidative stability of selected vegetable oils.

Materials and methods

Materials

B. vulgaris L. was obtained from the Barberry Collection Garden at the Research Institute of Food Science and Technology in Mashhad, Khorasan, Iran. The garden is situated at a latitude of 36° 44 ‘N and a longitude of 59° 4’ E, at an elevation of 1116 m above sea level, with an annual average temperature of 14.3 °C and 251 mm of precipitation. Permission for the collection of B. vulgaris L. was obtained from the relevant local authorities, and all necessary licenses were secured before sample collection. The experiments adhered to all relevant institutional, national, and international guidelines. The specimens were formally identified by Dr. Shokoh Esmail Begi, and a voucher specimen (No. 9075) has been preserved in the herbarium of the Biology Department at Urmia University, Urmia, Iran. Casein, ethanol, pepsin, trypsin, DPPH (2,2-diphenyl-1-picrylhydrazyl), and Tris were obtained from Merck. Freshly produced plant oils, including flaxseed oil, sweet almond oil, hemp oil, and pumpkin seed oil, were purchased from a grocery store. Other materials, such as sodium thiosulfate, chloroform, potassium iodide, monopotassium phosphate, and methanol, were of analytical grade.

Extraction of anthocyanin

The anthocyanin extraction was conducted using the maceration method. Fruits of B. vulgaris were ground using a grinder. A total of 120 g of barberries was mixed with 900 ml of ethanol. The mixture was shaken for one hr and then stored in a refrigerator at 4 °C for one day. Afterward, the solution was filtered and stored in bottles at 4 °C18.

Encapsulation

A 0.25% (w/v) concentration of casein, used as the wall material, was prepared in a 0.1 M Tris–HCl buffer and adjusted to pHs 2, 4, and 6. For the encapsulation process, 1 ml of barberry anthocyanin extract was mixed with 1 ml of casein dispersion at each pH. After 15 min of incubation, the mixtures were centrifuged at 8000 g for 10 min, and the capsules were isolated from the supernatant19.

Total anthocyanin content (TAC)

The concentrations of anthocyanins in the extract (before encapsulation) and in the supernatant of casein-encapsulated samples (after encapsulation) were determined using the pH differential method to quantify the total monomeric anthocyanin content. This method relies on the difference in absorbance of monomeric anthocyanins at 520 and 700 nm, utilizing potassium chloride at pH 1.0 and sodium acetate at pH 4.5. Absorbances at 520 and 700 nm for the samples diluted in the respective buffers (pHs 1.0 and 4.5) were recorded. The anthocyanin pigment concentration, expressed as cyanidin-3-glucoside equivalents, was calculated using the following formula:

$${\rm Anthocyanin\: pigment \:(mg/L)=(A^*MW^*DF^*10^{3})/(\varepsilon ^*l)}$$

Where A = (A520nm -A700nm) pH1 – (A520nm -A700nm) pH4.5; MW (molecular weight) = 449.2 g/mol for cyanidin-3-glucoside; DF = dilution factor established in D; l = pathlength in cm; ε = 26,900 molar extinction in L* mol− 1 *cm− 1, for cyanidin-3-glucoside and 103 = conversion factor from g to mg20.

Encapsulation efficiency (EE%)

The EE% of the nanocapsules was calculated using the total anthocyanin content of the samples before (TAC0) and after (TAC1) the encapsulation process at different pH values, based on the following equation:

$${\rm EE\% = ((TAC_0-TAC_1)/TAC_0)) *100}$$

Here, TAC0 represents the total anthocyanin content in the initial encapsulation mixtures, while TAC1 indicates the unentrapped amount21.

Characterization of nanocapsules

According to the best result of EE%, the dispersion of the casein-encapsulated sample (pH 2) was dried using the freeze-drying method. FESEM analysis was performed with the Sigma VP model (ZEISS), while FTIR analysis was conducted using the Thermo Nicolet Nexus 670 (USA) with KBr pellets.

Release

A UV-Vis spectrophotometer was used for all in vitro measurements of the release behavior of casein–anthocyanin nanocapsules in simulated gastric and intestinal fluids22. Simulated gastric fluid (SGF) was prepared by dissolving 0.2 g of sodium chloride (NaCl) in 0.7 ml of hydrochloric acid (HCl) and adjusting the pH to 1.2, followed by the addition of 0.32 g of pepsin. Simulated intestinal fluid (SIF) was prepared by dissolving 0.68 g of monopotassium phosphate (KH₂PO₄) in 0.2 M sodium hydroxide (NaOH), adjusting the pH to 6.8, and subsequently adding 1 g of trypsin.

Next, 0.05 g of casein–anthocyanin nanocapsules was added to either the SGF or SIF solution. The mixtures were incubated in a water bath at 37 °C for 2 h and then centrifuged at 1000 g for 10 min.

Following the 2 h incubation, the pH of the digestion mixtures was adjusted to 1.0 and 4.5 using potassium chloride and sodium acetate buffer solutions, respectively. The concentration of released anthocyanins was then quantified according to the method described in Sect. “Total anthocyanin content (TAC)23.

Determination of antioxidant activity

The antioxidant activity of the extract and prepared casein nanocapsules of B. vulgaris was compared by using the DPPH assay24. A 0.004% DPPH solution was prepared in methanol. Subsequently, 0.5 ml of B. vulgaris extract and 0.5 g of nanocapsules were added separately to 1 ml of Tris buffer at pH values of 2, 4.64, and 7.4.

Next, 1 ml of each sample was mixed with 2 ml of the DPPH solution. The absorbances of the samples were measured at 520 nm after 30 min. The antioxidant activity was calculated using the following equation:

$${\rm DPPH \:scavenging \:activity (\%) =((A_0-A_1)/A_0) *100}$$

where A0 and A1 represent the absorbance of the blank and sample solutions, respectively.

Comparison of the oxidative stability of vegetable oils in the presence of B. vulgaris extract and casein nanocapsules

To investigate the oxidative stability of vegetable oils— specifically flaxseed, sweet almond, hemp, and pumpkin— 0.13 g of both unencapsulated casein and casein-anthocyanin-encapsulated was added to 3 ml of each oil. These mixtures were stored for one month alongside control vegetable oils. The extent of oxidation in the vegetable oils was measured using the peroxide value.

The peroxide value was calculated using the acetic acid-chloroform method, as outlined by the American Oil Chemists’ Society (AOCS cd 8b-90)25. Each sample was combined with 30 ml of an acetic acid-chloroform solution (in a 3:2 ratio), followed by the addition of 0.5 mL of saturated potassium iodide solution. The mixture was left in the dark for one min, after which 30 ml of distilled water and 0.1% starch indicator were added. The solution was then titrated with 0.01 N sodium thiosulfate solution, and the peroxide value was calculated using the following formula:

Peroxide value (meq O2/kg) =((Vs-Vb) N*100)/w.

In this formula, “Vs” and “Vb” represent the volume (ml) of sodium thiosulfate used for the sample titration and the blank titration, respectively. “N” is the normality of sodium thiosulfate, and “w” represents the grams of the sample used.

Comparison of the antioxidant activities of vegetable oils in the presence of free extract and casein-encapsulated B. vulgaris

To evaluate the antioxidant activity of flaxseed oil, hemp oil, pumpkin oil, and sweet almond oil in the presence of B. vulgaris anthocyanin nanocapsules (0.5 g) and extract (0.5 ml), the DPPH assay was conducted under the conditions described in Sect. “Determination of antioxidant activity”.

Statistical analysis

All experiments were statistically analyzed using IBM SPSS Statistics 26 software. The results are presented as means and standard deviations (SD).

Results and discussion

Nanoencapsulation at different pH levels

The encapsulation efficiency (EE) of anthocyanins in casein-based nanocapsules is highly dependent on pH. The highest EE was observed at pH 2 (59.34 ± 3.6%), followed by pH 6 (53.36 ± 2.46%), and the lowest at pH 4.64 (49.52 ± 1.17%). This trend highlights the synergistic interplay between the pH-dependent conformational and structural responses of casein and the pH-sensitive chromogenic behavior of anthocyanins26,27 Fig. 1.

Fig. 1
figure 1

EE% of B. vulgaris at different pHs. Data are means of three replicates with standard errors (Mean ± SE, n = 3). Data with different letters are significantly different (P < 0.05).

At pH 2, anthocyanins predominantly exist in their thermodynamically stable, positively charged flavylium cation form28,29. Concurrently, casein solubility increases as carboxyl and phosphate side chains become protonated, resulting in a net positive surface charge on the protein and enhancing intermolecular electrostatic repulsion. Despite the resulting like-charge repulsion between anthocyanins and casein, high encapsulation efficiency (EE) is likely achieved due to the intrinsic hydrophobicity of the flavylium core, which promotes non-covalent interactions with hydrophobic protein domains27.. Additionally, the presence of ethanol disrupts phosphoserine-mediated calcium cross-links within casein aggregates and increases protein surface hydrophobicity, thereby improving conformational flexibility and facilitating efficient entrapment of anthocyanins30.

In contrast, at pH 4.64, the isoelectric point (pI) of casein, the combination of markedly reduced solubility and minimal net surface charge disrupts micellar integrity, diminishes electrostatic repulsion, and weakens hydrophobic and hydrogen-bonding interactions. This collectively results in the lowest encapsulation efficiency of 49.52 ± 1.17%.

Above pH 4.6, casein acquires a net negative surface charge due to the deprotonation of carboxyl and phosphate functional groups31. Concurrently, anthocyanins undergo structural transformation to the quinonoidal base, which is anionic, less thermodynamically stable, and more susceptible to oxidative degradation29. Despite the unfavorable electrostatic repulsion between the negatively charged casein and the quinonoidal anthocyanins, moderate encapsulation efficiency is still achieved, primarily through non-covalent interactions. Specifically, FTIR analysis (Sect. “FTIR analysis”) confirms the contribution of hydrophobic interactions and hydrogen bonding, where the aromatic rings and phenolic –OH moieties of the quinonoidal anthocyanins associate with the amphiphilic structure of casein, particularly its hydrophobic domains. Nevertheless, casein exhibits a markedly higher affinity for the flavylium cation, the predominant, positively charged, and stable form of anthocyanins under acidic conditions, leading to significantly enhanced encapsulation efficiency at low pH.

Mahdavi et al. (2016) stated that encapsulation efficiency depends on the type of wall material and the core-to-wall ratio. They encapsulated anthocyanins extracted from B. vulgaris using spray drying with maltodextrin, Arabic gum, and gelatin. The results indicated that encapsulation efficiency ranged from 89.06% to 96.21%32.

Characterization of capsules

FESEM analysis

Due to the highest EE% observed, FESEM images were obtained from casein samples with and without anthocyanin content at pH 2 using the freeze-drying method. The FESEM images of unencapsulated casein (Fig. 2 (a-b)) revealed a porous morphology characterized by surface pores with heterogeneous size distributions, ranging from 20 to 250 nm (mean size = 25 nm). This indicates a non-uniform structural pattern that may impact the overall functionality of the capsules. Structural features such as network porosity and uniformity are influenced by pH and the freeze-drying process, during which ice crystals form and are removed by sublimation. This process creates porous structures that replicate the original ice pattern, and the removal of water leads to the formation of new pores within the material33.

After encapsulation with anthocyanin (Fig. 2 (c-d)), the pores appeared filled, with anthocyanin visible as distinct surface protrusions. This morphological change indicates the successful incorporation of anthocyanin into the casein matrix, confirming the effectiveness of the encapsulation process. The surface of the anthocyanin capsules has a smooth texture, free of visible cracks or porous areas. The uneven structure results from the rearrangement of the protein matrix due to the high electric charge of the anthocyanins. The presence of particles ranging from 144 to 252 nm (mean size = 109 nm) suggests that the freeze-drying method and electrostatic interactions contribute to increased particle cohesion and reduced porosity of casein micelles.

Fig. 2
figure 2

FESEM images of casein micelles (a - b) before, and (cd) after encapsulation of B. vulgaris extract.

FTIR analysis

The FTIR analysis of the B. vulgaris anthocyanin extract confirmed a significant presence of phenolic and flavonoid compounds (Fig. 3). A characteristic peak at 3403 cm⁻¹, attributed to the stretching vibration of hydroxyl (O–H) groups, indicates the presence of active antioxidant compounds in the extract. Additionally, absorption bands at 1730 and 1231 cm⁻¹, corresponding to aromatic benzopyran structures, further confirm the flavonoid nature of the extracted components34.

Following the encapsulation of anthocyanins with casein, the Amide I band showed no significant shift (1633.09 → 1633.13 cm⁻¹) but exhibited noticeable broadening, indicating heterogeneous hydrogen bonding between the C = O groups of casein and the hydroxyl groups of anthocyanins. Simultaneously, the Amide II band shifted to lower wavenumbers, a change associated with N–H bending coupled with C–N stretching. This suggests that the N–H groups of casein also formed hydrogen bonds with the electron-rich phenolic –OH groups of anthocyanins. Together, these spectral changes provide clear evidence of multifaceted hydrogen bonding interactions that facilitate the molecular integration of anthocyanins into the casein matrix35,36. The reappearance of characteristic flavonoid peaks at 1728 cm⁻¹ after encapsulation further demonstrates the preservation of the chemical structure of the active compounds.

Fig. 3
figure 3

FTIR spectra of (a) B. vulgaris extract, casein matrix (b) before, and (c) after encapsulation of B. vulgaris extract.

Release under simulated gastric and intestinal conditions

The release study was designed to simulate gastrointestinal digestion and evaluate the protective capacity of casein nanocapsules, rather than to model controlled drug-release kinetics. Spectrophotometric analysis demonstrated that the release of anthocyanins from the capsules in simulated gastric and intestinal environments was significantly influenced by the proteolytic enzymes pepsin and trypsin37. Pepsin, which exhibits optimal activity under the acidic conditions of the stomach, degrades the casein matrix38, resulting in a higher release of anthocyanins (0.11 ± 0.04 mg/l). This suggests that the acidic environment of the stomach accelerates the degradation of the casein coating, leading to quicker release of anthocyanins, which may compromise their stability. In contrast, trypsin, active in neutral to alkaline pH39, induced a lower release of anthocyanins (0.09 ± 0.05 mg/l) because the casein coating retains its gel-like structure under these conditions, thereby slowing degradation. This indicates that the casein matrix exhibits enhanced stability in higher pH environments. At natural to alkaline pH levels (≥ 7), casein micelles show increased charge due to the ionization of carboxyl groups, leading to greater electrostatic repulsion and improved colloidal stability. This structural stabilization is advantageous for protecting sensitive compounds during gastrointestinal transit and facilitates a more controlled release, especially in the intestinal environment. Therefore, the pH-dependent behavior of casein micelles can be strategically utilized to design targeted delivery systems for functional foods and nutraceuticals40.

A comparative analysis of different wall materials—gelatin, soy protein isolate, maltodextrin, and acacia gum—used in the encapsulation process revealed that that after 2.5 h of simulated in vitro digestion, the lowest anthocyanin release was observed in microcapsules containing soy protein isolate (27.1% total anthocyanins), followed by gelatin (28.7%), acacia gum (54.2%), maltodextrin (63.0%), and the unencapsulated sample (70.9%). These results confirm that encapsulation, particularly the type of wall material used, can significantly influence the protection of anthocyanins from degradation during gastrointestinal digestion41,42.

Antioxidant activity

Comparison of the antioxidant activity of B. vulgaris extract and casein capsules at different pHs

The antioxidant activity of B. vulgaris extract and its casein-encapsulated form was compared at three pH levels: acidic pH (which corresponded to the highest EE%), pH 4.64 (the isoelectric point of casein), and pH 7.4 (physiological pH). The results are illustrated in Fig. 4. The extract showed the lowest antioxidant activity (86.12 ± 0.11%) at pH 2, while the encapsulated form demonstrated the highest antioxidant activity (92.83 ± 0.3%) at pH 7.4.

Fig. 4
figure 4

Comparison of the antioxidant activity of B. vulgaris extract and casein capsules at different pHs. Data with different letters are significantly different (P < 0.05).

Free radicals can damage cellular compounds such as lipids, proteins, and DNA due to their high reactivity. Anthocyanins, through their antioxidant activity, play a significant role in protecting cells from oxidative damage, thereby maintaining cellular integrity and reducing the risk of chronic diseases43. At acidic and near-neutral pH levels (2 and 4.64), anthocyanins predominantly exist in their flavilium cation form, which exhibits limited antioxidant activity due to a poor electron-donating capacity. The antioxidant activity of anthocyanins is directly related to the ionization of their phenolic groups44.

As the pH increases to 7.4, the antioxidant activity of the samples improves, attributed to the deprotonation of the phenolic groups of anthocyanins, enhancing electron donation45. Studies have shown that the antioxidant activity of anthocyanins increases significantly with rising pH levels, thereby enhancing their effectiveness in neutralizing reactive oxygen species (ROS)46. Furthermore, casein acts as a protective coating that not only shields anthocyanins from oxidative degradation but also enhances their stability and increases their bioavailability and antioxidant activity across all pH levels through the encapsulation process47.

Comparison of the antioxidant activity of vegetable oils in the presence of B. vulgaris extract (as free anthocyanin) and casein-based capsules (as encapsulated anthocyanin)

The assessment of antioxidant activity in the presence of B. vulgaris extract (as free anthocyanins) and casein-based nanocapsules (as encapsulated anthocyanins) revealed distinct effects. In flaxseed oil, the encapsulated anthocyanins significantly enhanced antioxidant activity compared to the free anthocyanins. Conversely, in hemp, pumpkin, and sweet almond oils, free anthocyanins were more effective. This suggests a synergistic interaction between anthocyanins and the natural antioxidants present in the oils (Fig. 5).

In this section, the antioxidant activities of four selected vegetable oils—flaxseed oil, hemp oil, pumpkin seed oil, and sweet al.mond oil—were investigated by incorporating B. vulgaris extract and casein-based nanocapsules. Flaxseed oil is known for its high omega-3 content; hemp oil has a balanced ratio of omega-3 and omega-6 fatty acids; pumpkin seed oil contains omega-6, omega-9, vitamin E, and plant sterols; and sweet al.mond oil is rich in omega-9, along with saturated and monounsaturated fats. All these oils are recognized for their antioxidant properties. However, the results indicated that these oils exhibited low antioxidant activity. Casein, serving as a carrier, enables controlled release and improves the stability of phenolic compounds48. However, the natural constituents of the oils may compete with the casein, and the fatty acid composition of each oil directly affects the efficiency of antioxidant release. Thus, the observed differences in antioxidant activity may stem from interactions between the casein matrix and oil compounds, which could hinder the effective release of anthocyanins from the capsules49,50. These findings indicate a complex interplay between the oil’s chemical composition and the encapsulation system, highlighting that the performance of encapsulated anthocyanins depends on the type and chemical profile of the oil51,52,53,54.

Fig. 5
figure 5

Comparison of the antioxidant activity of vegetable oils in the presence of B. vulgaris extract (as free anthocyanin) and casein-based capsules (as encapsulated anthocyanin). Data are means of three replicates with standard errors (Mean ± SE, n = 3). Data with different letters are significantly different (P < 0.05).

Comparison of the peroxide value of vegetable oils in the presence of B. vulgaris extract (as free anthocyanin) and casein-based capsules (as encapsulated anthocyanin)

Four selected vegetable oils—flaxseed oil, hemp oil, pumpkin seed oil, and sweet almond oil—were supplemented with B. vulgaris extract and casein-based nanocapsules. The peroxide values of these oils were measured after one month of storage (Fig. 6).

Hemp oil, which has a high content of polyunsaturated fatty acids (PUFAs) such as omega-3 and omega-6, is naturally highly susceptible to oxidation, as indicated by a peroxide value of 48.16 ± 0.92 meq O2/Kg. The addition of casein reduced this value to 37.75 ± 1.43 meq O2/Kg, demonstrating the antioxidant properties of casein. When casein–anthocyanin nanocapsules were incorporated, the peroxide value decreased further to 4.04 ± 0.06 meq O2/Kg, which can be attributed to the strong antioxidant activity of anthocyanins and their synergistic effect within the lipid matrix. This significant reduction in peroxide value markedly enhances the oxidative stability of hemp oil.

Pumpkin seed oil, which predominantly contains monounsaturated fatty acids (MUFAs), is naturally more resistant to oxidation, exhibiting an initial peroxide value of 9.29 ± 0.13 meq O2/Kg. However, the addition of casein increased the peroxide value to 37.58 ± 0.67 meq O2/Kg, possibly due to interactions between casein and the oil components that may promote oxidation. Nonetheless, the incorporation of casein–anthocyanin nanocapsules reduced the peroxide value to 30.24 ± 0.53 meq O2/Kg, indicating the antioxidant effect of anthocyanins, although this effect was less pronounced in pumpkin seed oil compared to hemp oil. This difference is particularly notable in oils with higher PUFA content, such as hemp oil.

Flaxseed oil, which is rich in omega-3 fatty acids, has a moderate susceptibility to oxidation, with an initial peroxide value of 24.96 ± 0.35 meq O2/Kg. The addition of casein increases the peroxide value to 42.73 ± 0.85 meq O2/Kg, suggesting that casein may accelerate oxidation rather than provide an antioxidant effect. However, incorporating casein–anthocyanin nanocapsules significantly reduces the peroxide value to 4.01 ± 0.06 meq O2/Kg, demonstrating the strong protective effect of anthocyanins in preventing omega-3 oxidation. This indicates that anthocyanins can effectively enhance the oxidative stability of omega-3-rich oils.

Sweet almond oil, which is rich in monounsaturated fatty acids (MUFA) such as oleic acid, exhibits high oxidative stability, with an initial peroxide value of 10.18 ± 0.16 meq O2/Kg. The addition of casein results in a slight increase in the peroxide value to 13.63 ± 0.27 meq O2/Kg, but this does not significantly impact the oil’s stability, leading to only a minimal rise in peroxide levels. In contrast, incorporating casein–anthocyanin nanocapsules results in a significant reduction in the peroxide value to 4.37 ± 0.07 meq O2/Kg, demonstrating the protective effect of anthocyanins in the oil. This reduction indicates that the inherent stability of sweet almond oil requires fewer antioxidants.

Fig. 6
figure 6

Comparison of the peroxide value of vegetable oils in the presence of casein (without B. vulgaris extract) and casein-based capsules (with B. vulgaris extract). Data are means of three replicates with standard errors (Mean ± SE, n = 3). Data with different letters are significantly different (P < 0.05).

Peroxide value (PV) is a crucial indicator for evaluating oil quality. Measuring the PV is an effective method for assessing the health and safety of oils, helping to prevent the consumption of harmful products55.

A key innovation in this study is the focus on anthocyanin encapsulation rather than oil encapsulation, which sets it apart from previous research. Earlier studies often used different encapsulation methods to prevent oxidation in oils; however, these methods faced issues like the breakdown of the protective layer and negative effects on sensory properties56,57. In contrast, this study presents a novel approach: casein–anthocyanin nanocapsules are added directly to the oil as a functional additive instead of encapsulating the oil itself.

The antioxidant properties of casein are well known. In the present study, free (non-encapsulated) casein was found to accelerate the oxidation rate of most tested vegetable oils, except for hemp oil. An acidic pH might lower the indirect antioxidant effect of casein by causing protein precipitation58. However, when anthocyanins were encapsulated in casein micelles, the oxidation rate of the oils was significantly reduced. This shows how well casein-based encapsulation protects anthocyanins and improves their antioxidant activity in lipid systems. These results agree with those of Chen et al. (2022), who found that casein boosts the stability, antioxidant activity, and bioavailability of lotus anthocyanins59.

This new strategy puts antioxidants directly into the oil. This helps to scavenging free radicals more effectively. The resulting system takes advantage of the protective effects of protein and antioxidant agents, which significantly improve oxidative stability. Additionally, being able to adjust the amount of these capsules does not harm the sensory characteristics of the oil. This method is also easy to use in industrial applications, making it very beneficial for extending the shelf life of food and pharmaceutical products.

Conclusion

This study examined how well B. vulgaris anthocyanin extract can be encapsulated with a casein-based biopolymer under different pH levels. The results showed that pH had a significant effect on EE%, antioxidant activity, and the release profile of the extract. While the highest EE% and release happened in acidic conditions, the best antioxidant activity occurred at pH 7.4. FTIR and FESEM analyses confirmed that anthocyanins were successfully encapsulated in the casein matrix, creating a uniform and stable nanocapsule structure. Additionally, both free and encapsulated anthocyanin extracts improved the antioxidant activity of the vegetable oils studied. The casein-anthocyanin nanocapsules greatly increased the oxidative stability of the examined vegetable oils, except for pumpkin seed oil. The level of improvement depended on the type and composition of the oil, which affected the release profile of the casein carrier and the effectiveness of the antioxidants. Overall, encapsulated anthocyanins showed better performance than their free form in enhancing oxidative stability and antioxidant activity. These findings suggest that casein-based encapsulation systems may be promising for targeted delivery of antioxidants in food and pharmaceutical uses.