Introduction

Four-dimensional (4D) printing is a recently developed field originating from three-dimensional (3D) printing, displays promising capabilities and more potential applications (Momeni et al. 2017). It was invented and termed by a research group at the Massachusetts Institute of Technology (MIT) (Tibbits 2014). Several review studies have summarized the various developments and the applications of 4D printing (Xun Khoo et al. 2015; Choi et al. 2015; Momeni et al. 2017; Pei 2014; Pei et al. 2017). According to Pei (2014), 4D printing is “the process of building a physical object using appropriate additive manufacturing technology, laying down successive layers of stimuli-responsive composite or multi-material with varying properties. After being built, the object reacts to stimuli from the natural environment or through human intervention, resulting in a physical or chemical change of state through time.” According to this definition, the color changes of the 3D printed object after printing as a function of time could be considered as 4D printing.

Three aspects must be met for 4D printing to be achieved (Pei 2014). The first is the use of stimulus-responsive materials that are incorporated multi-materials with different properties. It can be defined as materials that would either change their shape or properties between different physical domains in a useful manner under the influence of certain environmental stimuli (Xun Khoo et al. 2015). The second is the stimulus that requires to trigger the alterations of shape/property/functionality of a 4D printed structure. Its selection depends on the requirements of the specific application, which also determines the types of smart materials employed in the 4D printed structures (Momeni et al. 2017). The last aspect to be met is the amount of time for the simulation to occur, and the final result is the change of state of the object.

Three-dimensional food printing provides an engineering solution for customized food design as well as personalized nutrition control and a prototyping tool to facilitate new food product development (Sun et al. 2015). Several studies have been conducted on 3D printing for food products (Azam et al. 2018; Lille et al. 2018; Liu et al. 2018a, b, 2019; Yang et al. 2018a, 2019; Dankar et al. 2018b; Wang et al. 2017a; An et al. 2019; Huang et al. 2019). In contrast, to date, there has been no study conducted on 4D printing in food except for Wang et al. (2017b). They fabricated different shapes of edible films triggered by hydration processes, where they found most of the food gels hydrated and changed volume as a result of absorbing water during hydrophilic interaction inside their molecular or intermolecular structure.

Currently, many researchers suggest printing-customized food with health promotion properties and eliminating or reducing undesirable ingredients and using healthy ingredients such as vitamins, fibers, phytochemicals (anthocyanins, carotenoids, betanidins) and fat or protein-based ingredients (Dankar et al. 2018a; Sun et al. 2018). These will improve the overall appearance, give diverse colors and texture properties to the printed food pieces, and also contribute to consumers’ health and well-being (Sun et al. 2018; Stintzing and Carle 2004). As color is one of the major issues for the food industry, where color mainly defines the esthetic value of food, predetermines consumers’ expectation of flavor and taste and modulates appetite (Bayarri et al. 2001). Also, as the visual appearance of the product is the main factor driving the initial choice for purchase, while subsequent purchases are greatly affected by eating quality. Besides, some studies have been conducted on the effect of the 3D printing on the color of the product (Dankar et al. 2018b; Le Tohic et al. 2018). But to date, there is no study conducted on the color change of printed food products over time after printing to an attractive color as a response to an internal or external stimulus. Therefore, the aim of the present study was to fabricate a 4D food product with health promotion properties, where the 3D printed food product can change its color over time to an attractive color (the 4th dimension) as a response to the external or internal stimuli. This is very important for the food industry or additive manufacturing technology to fabricate a 3D healthy food product with attractive colors and different color intensity that satisfy different consumers’ tastes depending on the prevailing pH stimulus, the printed materials, and the product consumption time after printing.

Therefore, anthocyanin was selected as a smart material because it is able to alter its color as a response to a particular stimulus, such as pH (Kan et al. 2017). Moreover, for its great importance, it has several health-promoting properties, including antioxidant (Tsuda et al. 2003), anti-cancer (Hakimuddin et al. 2004; Umar Lule and Xia 2005; Hou 2003), anti-inflammatory (Wang and Mazza 2002), human nutrition (Stintzing and Carle 2004), anti-cardiovascular disease, and anti-diabetic properties (Graf et al. 2013; Espín et al. 2007). In fact, eating anthocyanin-rich fruits and vegetables may help boost overall health. Where, Graf et al. (2013) reported that anthocyanin-rich juice reduced serum cholesterol as well as decreased the amount of saturated fatty acids in plasma and increased the proportion of polyunsaturated fatty acids. In addition, anthocyanins can repair damaged proteins in the blood vessel walls (Horbowicz et al. 2008). Several review studies have discussed these health benefits of anthocyanin consumption (Burton-Freeman et al. 2016; Duthie et al. 2000).

Besides, anthocyanin ingestion as a food additive material is unlikely to present a safety concern, because there are no reports indicating any adverse health effects with the consumption of anthocyanins at normal dietary intake levels (Kamiloglu et al. 2015). The adverse side effects occur only at very high levels, although there is no complete assessment of anthocyanin toxicity (EFSA 2013). Currently, there are no recommended intake levels for anthocyanin consumption to avoid adverse side effects or for optimal health. However, the average daily intake of anthocyanins in the USA diet is estimated to be as much as 180–255 mg per day (Kuhnau 1976). Therefore, the anthocyanin concentrations (0.1, 0.15, and 0.2%) used in this study were selected on this basis to be less than or in this range per 100 g of the final product.

Moreover, we chose pH as a stimulus because anthocyanin can be found in different chemical forms, resulting in different colors, which depend on the pH of the solution (Brouillard 1982; Bridle and Timberlake 1997; Cooper-Driver 2001; Castañeda-Ovando et al. 2009; Choi et al. 2017; Kan et al. 2017).

This study was divided into two stages: at the first stage, we fabricated a 4D food product, where the 3D printed anthocyanin-potato starch gel can change its color over time when exposed to an external stimulus (pH). In this stage, we first studied the effect of adding different concentrations of potato starch on the quality of the geometrical shape and the intensity of the color change of 3D printed anthocyanin-potato starch (PS) gel after spraying with different pH solutions. Second, the intensity of the color change of 3D printed anthocyanin-PS gel after spraying with different pH solutions at different anthocyanin concentrations were studied. At the second stage, a 3D food product that can change its color independently over time to attractive color without exposing to an external stimulus was printed. To achieve this, two parts of a food product were combined, one part has the smart material (anthocyanin) and another part has the stimulus (pH). Therefore, the lemon juice gel was selected, which contains the stimulus (pH) because it is the lowest food product in pH value, while the second part was from anthocyanin-PS gel, which contains the smart material (anthocyanin).

Materials and Methods

Materials

Anthocyanin purple-red powder 25% extracted from blueberry fruits using UV spectrophotometric detection was purchased from Workshop Moist Reaf, China. It was stored in a refrigerator at 4 °C. PS was purchased from Dongguan Yongyi Foods Co., Ltd. Guangdong, China. The moisture content of PS was 15.72 ± 0.33% (wet basis), 95.5 ± 0.5% purity, with amylose and amylopectin ratios of 24.7 ± 0.2% and 75.3 ± 0.2%, respectively.

Lemon fruits were provided by Jiangsu Laifu Agriculture & Technology Co. Ltd. Sichuan, China. They were stored at 4 °C before use. The fruits were washed, peeled, and juiced. Thirty milliliters of the juice was mixed with sugar (26 g sucrose) and water (160 ml) according to USDA (1962). The pH of the produced lemon juice (2.29 ± 0.01) was measured by a digital pH meter (Starter 3100, Shanghai, China). The total soluble solids (TSS) content (13.5 Brix) was measured using a refractometer (Aipu 0-90, Zhejiang, China).

Preparing pH Solutions

Different pH solutions (pH 2 to 10) were prepared using food-grade materials to ensure safety and accessibility. Citric acid (C6H8O7), trisodium citrate (Na3C6H5O7), sodium bicarbonate (CHNaO3), sodium hydroxide (NaOH), and deionized water (H2O) were used. The pH of the solutions was determined and adjusted by a digital pH meter (Starter 3100, Shanghai, China).

Preparing Anthocyanin-PS Gel

Three concentrations of anthocyanin (0.1, 0.15, and 0.2 g/100 ml water) were prepared and homogenized with different PS concentrations (7.5, 10, 12.5, 15 g/100 ml anthocyanin solution) in a 250 ml glass container. Then, the samples were heated at 53.5 °C using a heating plate coupled with a magnetic stirrer (Hotplate Mixer Digital Display, Model: XR 85-2, China) according to Shiotsubo (1983). They reported that the lowest temperature at which the gelatinization process could occur at 52.5 °C, a temperature which is lower than the so-called gelatinization temperature. The samples were stirred continuously throughout the heating period (10 min). Heating at such low temperature has the advantage of limiting the damage on anthocyanin level. According to Khanal et al. (2010), the heating up to 40 to 60 °C does not affect significantly the total anthocyanin level. The glass beaker holding the homogenous solution was then wrapped with food grade plastic protective film to prevent water loss from the anthocyanin-PS gel. Afterwards, the samples were kept at room temperature to cool down. Finally, the gel was loaded carefully into syringes using a flat spatula to avoid entrapping of air spaces inside the syringe. All these steps were displayed in a systematic diagram as illustrated in Fig. 1.

Fig. 1
figure 1

Systematic diagram for experiment steps

Preparing Lemon Juice Gel

Lemon juice was firstly homogenized with different PS concentrations (7.5, 10, 12.5, 15 g/100 g juice) in a glass beaker. Then, the samples were heated using the same method for preparing anthocyanin-PS gel. Then, the samples were kept at room temperature to cool down.

3D Models

The models used to print were designed by SketchUp Pro2015 (version 15.0). At the first stage, when we wanted to print one material, the shape of the material to be printed was designed using SketchUp program (three shapes with dimensions 36 × 31 × 4.5 mm, 36 × 31 × 9 mm, and 36 × 31 × 12 mm) and exported as a stereolithography (stl.) file and assigned them to the default extruder in Slic3r. At the second stage, we wanted to print a multi-material object; an object consisting of two parts with dimensions 36 × 31 × 6 mm each was designed. Each part was then exported as a stl. file. Finally, the stl. files of the two parts were merged together and assigned each file to one extruder in Slic3r. The extruder offset and retraction value were preoptimized using two extruders in the printing process.

3D Printer and Printing Process

The 3D food printer used in this study was a syringe type fused deposition modeling (FDM) printer (SHINNOVE-D1, Shinnove Co. Ltd., Hangzhou, Zhejiang, China) as described by Liu et al. (2018c) (Fig. 2). This food printer consists of a dual-nozzle system specially designed for printing food materials. In this study, we used only one extruder at the first stage for printing one material objects and two extruders at the second stage for printing 3D multi-material objects. The printing process was controlled by a specially designed motor. “Slic3r” was used for slicing of the stl. to G-code files for the printing process. The printing parameters used to print were 0.85 mm nozzle diameter (dn), 0.85 mm nozzle height (hn), and 25 mm/s printing speed (s). All these printing parameters were properly adjusted according to pre-tests to get the desired results. Room temperature of 25 °C was applied in the printing process. The products were printed on a thin layer of plastic (1 mm thickness).

Fig. 2
figure 2

Schematic illustration of the 3D printer system (Liu et al. 2018c)

Color Measurements

The color of samples was measured using a colorimeter (CR-400, Konica Minolta Co., Japan) that express color in numerical terms along the L*, a*, and b* axes. The coordinate L* is called the lightness. The coordinates a* and b* form a plane perpendicular to the lightness. The coordinate a* is the color redness that defines the deviation from the achromatic point corresponding to lightness, to red when it is positive and to green if negative. Whereas, the coordinate b* is the color blueness that defines the turning to yellow, if positive and to blue, if negative (Messina et al. 2012). After calibration using a white reference plate, each sample was placed on a white plate then L*, a*, and b* values were recorded in triplicate to evaluate color changes after 90 min from spraying with pH solutions or the spontaneous color change over time at (0, 30, 60, and 90 min). All readings were taken at three random locations from the surface of each sample and the average was used to express the color of the individual sample. All samples were prepared in triplicate for every pH-sprayed samples and five replications for spontaneous color change samples.

Sensory Evaluations

Consumer acceptability test based on sensory characteristics of the 3D food product was conducted by a panel of 30 members of food science students, ranging in age from 20 to 35 years old. The samples were coded as follows: A = control (one part of anthocyanin-PS gel without any treatment), B = (one part of anthocyanin-PS gel treated with pH 2), C = (one part of anthocyanin-PS gel treated with pH 2.5), D = (one part of anthocyanin-PS gel treated with pH 3), E = (one part of anthocyanin-PS gel treated with pH 3.5), F = (two parts of anthocyanin-PS gel and PS gel), and G = (two parts of anthocyanin-PS gel and lemon juice gel). The 9-point hedonic scale was used to evaluated the products for their acceptability of color, flavor, taste, texture, and overall acceptability using a score ranging from dislike extremely (1) to like extremely (9) (ISO-4121 2003).

Statistical Analysis

The obtained data from triplicate for every pH-sprayed samples and five replications for spontaneous color change samples were subjected to statistical analysis using SPSS software (SPSS 25.0; IBM SPSS Statistics, Chicago, IL, USA). The analysis of variance (ANOVA) with the application of Duncan’s multiple-range test was conducted in order to ascertain whether there were any significant differences among the mean values of the test samples. Differences of (p ≤ 0.05) were considered to be significant.

Results and Discussion

To study anthocyanin response to color change we prepared anthocyanin-PS gel using different anthocyanin concentrations (0.1, 0.15, 0.2% (w/v)) and 7.5 g/100 ml PS by the method described previously (Fig. 1). Twenty milliliters of anthocyanin-PS gel was put into a small glass beaker. Then, the gel was treated with 1 ml of different pH solutions (pH 2, 3, 4, 5, 6, 7, 8, 9, and 10). The samples were then manually stirred and left until a uniform color change of all the samples were observed and the color change process terminated, indicating chemical equilibrium (Fig. 3).

Fig. 3
figure 3

The color of anthocyanin-PS gel before and after treatment with 1 ml of different pH solutions (2–10)

Figure 3 demonstrates the significant effect of the prevailing pH on anthocyanin color because of its use as a pH indicator. The color of samples displays a huge variety of color variations from red to green after treatment with pH solutions in the range of 2–10. This is because the ionic nature of anthocyanins allows the molecule structure to change according to the prevailing pH, leading to different colors and hues at various pH values (Brouillard 1982). Under various pH conditions, the hydroxyl (OH) and/or methyl ether (O-CH3) groups attached to the carbon rings undergo reversible structural transformations and ionization (Kan et al. 2017). Restructuring the anthocyanin molecule changes its way in light absorption, giving rise to color changes (Cavalcanti et al. 2011; Ananga et al. 2013). Moreover, the color intensity of anthocyanin-PS gel before and after treatment with pH solutions increased with increasing anthocyanin concentrations. This result agrees with Rein (2005), who reported that increasing anthocyanin concentrations lead to increased color intensity by multifold. It was observed that the color changed most significantly upon contacting with the pH solution and then completely changed after several minutes, especially the samples treated with pH 2, which resulted in more significantly rapid and intense color change compared to the other samples. In contrast, samples treated with pH values from 4 to 8 showed less color intensity and relatively slower change. This is consistent with the different ion concentrations in the pH solutions (Kan et al. 2017). Moreover, increasing the pH values lead to a decrease of both the color intensity and the concentration of the flavylium cation, as it is hydrated by nucleophilic attack of water, to the colorless carbinol form (Rein 2005). Thus, pH treatments ranging from 2 to 5 were selected for the present study to obtain a 3D food product with an attractive red color.

The Geometrical Shape and the Intensity of Color Change of 3D Printed Anthocyanin-PS Gel after Spraying with Different pH Solutions at Different Concentrations of Potato Starch

Starch is an excellent binder and widely used as a thickening agent in the food industry. Also, it helps to improve the rheological properties to achieve higher printability for 3DP as well as improves the sensory attributes of the food mixture (Azam et al. 2018). PS has good water retention capacity, transparency, and aging resistance properties (Zhang et al. 2001). Therefore, PS was chosen in this research as a gelling agent. The effect of adding different concentrations of PS (7.5, 10, 12.5, and 15 g/100 ml anthocyanin solution) on the quality of the geometrical shape and the color intensity of 3D printed anthocyanin-PS gel (36 × 31 × 4.5 mm) after spraying uniformly with pH 2, 2.5, 3, 3.5, 4, 4.5, and 5 solutions using a hand sprayer (each sample was sprayed five times (about 1 ml of pH solution)) were studied (Fig. 4). The color values L*, a*, and b* for each sample were measured using a colorimeter immediately after printing (Fig. 5) and after 90 min from spraying with pH solutions (Fig. 6). Similarly, we studied the geometrical shape and the color of anthocyanin-PS gel with increasing the thickness of the printed layer to 9 mm before and after spraying with pH 2.5 solution at different concentrations of PS. The color change in the internal layers by making a vertical section in every sample was also investigated (Fig. 7).

Fig. 4
figure 4

The color change of 3D printed anthocyanin-PS gel (36 × 31 × 4.5 mm) after spraying with different pH solutions (2 to 5) at different concentrations of potato starch (7.5, 10, 12.5, and 15 g/100 ml anthocyanin solution) (0.1% anthocyanin concentration)

Fig. 5
figure 5

The mean color values of 3D printed anthocyanin-PS gel before spraying with pH solution at different concentrations of potato starch (7.5, 10, 12.5, and 15 g/100 ml anthocyanin solution). Different letters above the series or column in the same group indicate significant differences (different letters outside the brackets indicate significant differences in a* values, different letters inside the brackets indicate significant differences in b* values) (p ≤ 0.05)

Fig. 6
figure 6

The mean color values of 3D printed anthocyanin-PS gel after spraying with different pH solutions (pH 2, 2.5, 3, 3.5, 4, 4.5, and 5) at different concentrations of potato starch (a = 7.5 g, b = 10 g, c = 12.5 g, and d = 15 g/100 ml anthocyanin solution). Different letters above the series or column in the same group indicate significant differences (different letters outside the brackets indicate significant differences in a* values, different letters inside the brackets indicate significant differences in b* values) (p ≤ 0.05)

Fig. 7
figure 7

The geometrical shape and the color of 3D printed anthocyanin-PS gel (36 × 31 × 9 mm) before and after spraying with 2.5 pH solution at different concentrations of potato starch (7.5, 10, 12.5 and 15 g/100 ml anthocyanin solution) (a after printing directly (before spraying), b after a 90 min from spraying with pH solution, c vertical section in every sample)

Figure 4 indicates that the color intensity of anthocyanin-PS gel before and after treatment with pH solutions decreased with increasing PS concentration. The color intensity of anthocyanin-PS gel with 7.5 g PS was better than the other PS concentrations. This is consistent with Lewis et al. (1995), who reported that the addition of amylose and amylopectin resulted in significant decreases in anthocyanin color. This is due to the ability of amylose and amylopectin to form inclusion complexes with anthocyanin. These inclusion complexes are increased by increasing the starch concentration, especially the amylose content for its efficiency compared with amylopectin in the formation of these complexes (Yamada et al. 1980; Lewis et al. 1995). pH samples 2, 2.5, 3, and 3.5 showed significant differences in color after treatment compared to control samples in all PS concentrations (7.5, 10, 12.5, and 15 g) (Fig. 4). However, samples treated with pH 4, 4.5, and 5 solutions did not show any visible differences in color compared to control samples (Fig. 4). This is because pH solutions between 4 and 5.5 very little color is left since the colorless carbinol and yellowish chalcone species dominate (Rein 2005).

Figure 7 shows the geometrical shape and the color of 3D printed anthocyanin-PS gel before and after spraying with pH solution 2.5 at different concentrations of PS (7.5, 10, 12.5 and 15 g). The results showed that the geometrical shape of 3D printed anthocyanin-Ps gel with 7.5 g and 10 g were better than 3D printed anthocyanin-Ps gel with 12.5 g and 15 g. Moreover, the color intensity and the surface smoothness of 3D printed anthocyanin-Ps gel were found the best in the 7.5 g samples before (Fig. 7a) and after treatment (Fig. 7b). Also, the color has changed in all layers with almost the same degree as shown from the vertical section in every sample (Fig. 7c). This indicated that the pH solution has permeated all layers and the chemical equilibrium has occurred.

The color values of 3D printed anthocyanin-PS gel before and after spraying with different pH solutions are shown in Fig. 5 and Fig. 6, respectively. Color measurements of the 3D printed anthocyanin-PS gel before treatment with pH solutions (Fig. 5) showed that the color values a* and b* decreased with increasing PS concentration. For example, the results revealed that increasing the PS concentrations from 7.5 to 15 g decreased a* value from 7.65 to 4.44 and b* value from 5.83 to 1.94 as illustrated in Fig. 5.

PS concentration significantly affected the color of 3D printed anthocyanin-PS gel. As indicated in Fig. 5, there was a significant difference among 7.5 g, 10 g, and 12.5 g or 15 g in L* and a* values (P ≤ 0.05). Furthermore, there was a significant difference among 7.5 g, 10 g, 12.5 g, and 15 g samples in b* values (P ≤ 0.05). However, there was no significant difference between 12.5 g and 15 g in L* and a* values (P ≤ 0.05).

Figure 6 indicates the color values of 3D printed anthocyanin-PS gel after spraying with different pH solutions (pH 2, 2.5, 3, 3.5, 4, 4.5, and 5) at different concentrations of PS (7.5, 10, 12.5, and 15 g). Compared to the control samples, samples treated with pH 2, 2.5, 3, and 3.5 showed highly significant differences (P ≤ 0.05) in color values after treatment in all PS concentrations (7.5, 10, 12.5, and 15 g). However, samples treated with pH 4, 4.5, and 5 showed only small differences in color values after treatment among each other and the control samples (Fig. 6). The color values a* and b* decreased, while L* value increased with the increase in pH values from 2 to 5. This is because at low pH values all the anthocyanin molecules are in flavylium form (red color), and with increasing pH values, it leads to a decrease in the concentration of the flavylium cation resulting in a colorless carbinol pseudo base form, which is colorless (Castañeda-Ovando et al. 2009; Rein 2005). Moreover, the results revealed that increasing the pH value from 2 to 5 decreased a* values as well as b* values and increased L* values at all PS concentrations (Fig. 6).

The Intensity of Color Change of 3D Printed Anthocyanin-PS Gel after Spraying with Different pH Solutions at Different Anthocyanin Concentrations

There is no doubt that increasing anthocyanin concentration will increase the color intensity. The present study had investigated the significance and impact of different concentrations of anthocyanin (0.1, 0.15, and 0.2%) on the final color of 3D printed anthocyanin-PS gel before (Fig. 8) and after treatment with pH solutions (pH 2, 2.5, 3, 3.5, 4, 4.5, and 5) (Fig. 9 and Fig. 10). As expected, the results showed that increased anthocyanin concentration led to the increase of color intensity of 3D printed anthocyanin-PS gel. However, the color difference between anthocyanin concentration of 0.15% and 0.2% was not noticeable. Moreover, in all anthocyanin concentrations (0.1, 0.15, and 0.2%), pH samples 2, 2.5, 3, and 3.5 showed distinct differences in color after treatment compared to control samples. However, pH samples 4, 4.5, and 5 did not show any visible differences in color after treatment compared to control samples (Fig. 9). As mentioned above, this is because in pH values between 4 and 5.5 very little color is left since the colorless carbinol and yellowish chalcone species dominate (Rein 2005).

Fig. 8
figure 8

The mean color values of 3D printed anthocyanin-PS gel before spraying with pH solution at different concentrations of anthocyanin (0.1, 0.15, and 0.2% (w/v)) (potato starch concentration (7.5 g/100 ml)). Different letters above the series or column in the same group indicate significant differences (different letters outside the brackets indicate significant differences in a* values, different letters inside the brackets indicate significant differences in b* values) (p ≤ 0.05)

Fig. 9
figure 9

Change the color of 3D printed anthocyanin-PS gel (36 × 31 × 4.5 mm) after spraying with different pH solutions (pH 2–5) at different concentrations of anthocyanin (0.1, 0.15, and 0.2% (w/v)) (potato starch concentration (7.5 g/100 ml)

Fig. 10
figure 10

The mean color values of 3D printed anthocyanin-PS gel after spraying with different pH solutions at different concentrations of anthocyanin (a = 0.1%, b = 0.15%, and c = 0.2% (w/v)). Different letters above the series or column in the same group indicate significant differences (p ≤ 0.05) (different letters outside the brackets indicate significant differences in a* values, different letters inside the brackets indicate significant differences in b* values)

Figure 8 presents the mean color values of 3D printed anthocyanin-PS gel before treatment with pH solutions. The results indicated that the color values a* and b* significantly increased and L* values significantly decreased with the increase of anthocyanin concentration. Similarly, Fig. 10 reveals the same trend after spraying with different pH solutions. This is because the increase of anthocyanin concentration in the product leads to increase the color intensity before and after treatment.

At the second stage, we aimed to print a 3D food product that can change its color independently over time to attractive color without exposing to any external stimuli. To achieve this, two parts of a food product were combined, one part has the smart material (anthocyanin) and the other part has the pH stimulus. Therefore, we chose lemon juice gel, which contains the stimulus (pH) as the first part because it is the lowest food product in pH value, while the second part was from anthocyanin-PS gel, which contains the smart material (anthocyanin). Firstly, the suitable concentration of PS for printing 3D lemon juice gel was investigated to obtain a good 3D printing behavior. As shown in Fig. 11, the geometrical shape of 3D printed lemon juice gel using PS concentration 10 g/100 g was better than the other concentrations at two infill percentages (40, 60%) (Fig. 11). Therefore, the formulation with 10 g PS concentration was used as the first part (lemon juice gel) of the final product.

Fig. 11
figure 11

The geometrical shape of printed lemon juice gel using different concentrations of potato starch (7.5, 10, 12.5, and 15 g/100 g juice) at two percentages of infill parameter (40, 60%)

Furthermore, 7.5 g PS concentration was used in the second part (anthocyanin-PS gel) for several reasons in addition to its good geometrical shape: firstly, it has more intense color and smooth surface making it more attractive compared to the other concentrations. Secondly, the mobility of water molecules is higher compared to other concentrations. This may be helpful in facilitating the chemical interaction between the two parts and accelerate the color change of the final product. This is mainly due to the increase in starch concentration leads to an increase in the number of starch molecules per unit volume, and increase the probability of intermolecular hydrogen bonding, leading to a more compact network structure, thus the strength of the gel increased (Nunes et al. 2006; Yang et al. 2018b). This strong gel significantly restricts the mobility of water molecules in the gel system (Yang et al. 2018b; Ozel et al. 2017). Thirdly, to reduce the starch concentration in the whole product so that other health substances can be added.

Two models (A) and (B) of 3D printed food product were created. Model (A) consists of two parts, the first part of lemon juice gel and the second part of anthocyanin-PS gel. Model (B) on the other hand, consists of two parts, the first part of PS gel only without lemon juice and the second part of anthocyanin-PS gel. These two models were used to illustrate the difference between the color change in both models due to the difference in pH values of lemon juice gel compared to PS gel only.

Figure 12 shows the spontaneous color change of 3D printed model (A) compared to model (B) over time after printing (at 0, 30, 60, and 90 min) at different anthocyanin concentrations (0.1, 0.15, and 0.2%). We also performed a vertical section investigation in some samples directly after printing to follow the spontaneous color change over time (Fig. 13). However, noteworthy, it was difficult to make the section without making shape deformation as a result of the lower consistency of the gel directly after printing.

Fig. 12
figure 12

Design of the 3D printed model (A) and model (B) and the spontaneous color change of 3D printed model (A) than 3D printed model (B) over time after printing (0, 30, 60, and 90 min) at different concentrations of anthocyanin (0.1, 0.15, and 0.2%)

Fig. 13
figure 13

Vertical section in the 3D printed model (A) to illustrate the spontaneous color change over time after printing (0, 30, 60, and 90 min) at different concentrations of anthocyanin (a = 0.1%, b = 0.15%, and c = 0.2%)

It can be seen that the color of 3D printed anthocyanin-PS gel in model (A) gradually changed from purple to red over time during and after the printing process at all anthocyanin concentrations (0.1, 0.15, and 0.2%) (Fig. 12). On the contrary, the 3D printed anthocyanin-PS gel in model (B) did not show any noticeable color change over time after printing (Fig. 12). This result was attributed to the difference in pH value between lemon juice gel and PS gel as explained in (Fig. 14).

Fig. 14
figure 14

The pH values of lemon juice gel, potato starch gel, and anthocyanin-PS gel before and after 90 min from printing with each other

When printing lemon juice gel as a bottom part with anthocyanin-PS gel as an upper part in the model (A), pH values of lemon juice gel and anthocyanin-PS gel became 2.58 and 2.74, respectively after 90 min from the printing process. On the other hand, when printing PS gel as a bottom part with anthocyanin-PS gel as an upper part in the model (B), pH values of PS gel and anthocyanin-PS gel became 5.59 and 5.11, respectively, after 90 min from printing process with a small difference compared to pH values before printing process (Fig. 14).

In model (A), the pH value of the upper part (anthocyanin-PS gel) significantly decreased from pH 5.13 before printing to 2.74 after 90 min from printing as a result of the low pH value of lemon juice gel as a bottom part (pH 2.55) (the pH value of anthocyanin-PS gel and lemon juice gel was determined after separating them from each other using a pH meter). This is because during the printing process of the upper part (anthocyanin-PS gel) and once the first layer of this part is printed on the bottom part (lemon juice gel), the diffusion of hydrogen ions occurs according to Fick’s first law from regions of high concentration (lemon juice gel) to regions of low concentration (anthocyanin-PS gel) due to the greater pH difference between lemon juice gel and anthocyanin-PS gel. This diffusion of hydrogen ions continues over time after printing until the equilibrium state achieved, which reduces the pH value of anthocyanin-PS gel to become close to the pH value of lemon juice gel, while in model (B), pH value of the upper part (anthocyanin-PS gel) was close to the bottom part (PS gel) so its value remained the same (pH 5.11) as before printing process (Fig. 14). As a result, there is a change in the color of the upper part with a pH value of less than 3.5 in model (A), but there is no change in the color of the upper part in model (B). Again, because changes in pH values cause reversible structural transformations in anthocyanin molecules, which leads to change its color as discussed above (Ananga et al. 2013; Kan et al. 2017). Moreover, this also because anthocyanins have little color at pH values higher than 3.5 as discussed above (Bridle and Timberlake 1997; Rein 2005).

Figure 15 presents the color values of the upper part (anthocyanin-PS gel) of the 3D printed model (A) and (B) over time after printing (at 0, 30, 60, and 90 min) at different concentrations of anthocyanin (A = 0.1%, B = 0.15%, and C = 0.2% (w/v)). Generally, the color values of the upper part of the 3D printed model (A) increased significantly over time after printing. Moreover, there are small differences in color values L* of model (A) and (B) at all anthocyanin concentrations (0.1, 0.15, and 0.2%). However, there are no significant differences in a* and b* of model B over time after printing at all anthocyanin concentrations.

Fig. 15
figure 15

The difference in color values between 3D printed model A (layer of lemon juice gel and a layer of anthocyanin-PS gel) and 3D printed model B (layer of Ps gel and layer of anthocyanin-PS gel) over time after printing (at 0 min (after printing directly), 30 min, 60 min, and 90 min) at different concentrations of anthocyanin (a = 0.1%, b = 0.15%, and c = 0.2% (w/v)). Different letters above the series or column in the same group indicate significant differences (different letters outside the brackets indicate significant differences in a* values, different letters inside the brackets indicate significant differences in b* values); Ns: means there were no significant differences (p ≤ 0.05)

Figure 16 shows the effect of different formulas and models on the color of the 3D product after printing directly and after 90 min from printing at different anthocyanin concentration. As discussed in detail above, the color of 3D printed anthocyanin-PS gel changed from purple to red and the color values a* and b* increased and L* values decreased with the increase of anthocyanin concentration after 90 min from spraying with pH 2.5 (Fig. 16a). Moreover, the color of 3D printed anthocyanin-PS gel in model (A) gradually changed from purple to red independently as a response to an internal pH stimulus from the bottom part (lemon juice gel) at all anthocyanin concentrations (Fig. 16b). In contrast, the 3D printed anthocyanin-PS gel in model (B) did not show any noticeable color change after 90 min from printing (Fig. 16c).

Fig. 16
figure 16

The effect of different formulas and models on the color of the 3D product after printing directly and after 90 min from printing at different anthocyanin concentration (0.1, 0.15, and 0.2%) (a one layer of anthocyanin-PS gel and then spray it with pH solution 2.5; b two parts, one of anthocyanin-PS gel and other of lemon juice gel (model A); and c two parts, one of anthocyanin-PS gel and other of potato starch gel (model B)

The Color Stability of the 3D Product

The 3D product was manufactured without the addition of preservatives for the immediate consumption within 24 h from printing at ambient temperature. This period has been determined to ensure the safety of product consumption in this period because the fungi began to appear on the surface of the product from the end of the second day, which means that the product began spoilage stages. Therefore, we examined the color stability of the 3D printed model (A) over storage at ambient temperature for 24 h. After printing, the product was wrapped by food grade plastic protective film to prevent the water loss during the storage. As shown in Fig. 17, the color of the product remained stable even after storage for 24 h at room temperature; moreover, it was improved. This improvement was due to the decrease of pH value of anthocyanin-PS gel over time to be equal to the pH value of lemon juice gel because of the continued diffusion of hydrogen ions till chemical balance as discussed above. The color stability was attributed to the fact that anthocyanin color is most stable at low pH values (Hubbermann et al. 2006). This result agrees with Clydesdale et al. (1979) who had reported that the stability of grape and cranberry anthocyanins for gelatin dessert after storage for 1 day of sunlight and 1 week of refrigeration was excellent. This also means that there was no degradation of anthocyanins in the product through this storage period; otherwise, the color intensity of the product would be reduced or even the occurrence of browning (Bridle and Timberlake 1997; Muche et al. 2018). In addition, the loss of anthocyanins is most significantly characterized by a reduction of redness (Hubbermann 2005).

Fig. 17
figure 17

Spontaneous color change of the 3D printed model (A) over time after printing (0, 30, 60, 90 min) and the color stability when storage for 12 h and 24 h at ambient temperature at different concentrations of anthocyanin (A = 0.1%, B = 0.15%, and C = 0.2%)

Sensory Evaluation of the 3D Printed Samples

Table 1 shows the average sensory scores for each attribute evaluated. Based on color, sample B (one part of anthocyanin-PS gel treated with pH 2) had the highest score for color followed by sample G (two parts of anthocyanin-PS gel and lemon juice gel). However, there was no significant difference between them. Furthermore, no significant difference was found among all samples in terms of texture attribute. Sample B gave the least score in taste as it was very sour. Finally, the flavor, taste, texture, and overall acceptability of sample G were evaluated as being best compared to all the samples. The improvement in all the attributes of this sample is due to the addition of lemon juice gel.

Table 1 Sensory scores of the 3D printed product

Therefore, we can say that adding the lemon juice gel as a bottom part was of great importance besides its work as a source of pH stimulus, where it gave a good flavor and taste and high nutritional value to the final product making it more acceptable compared to using one part of 3D printed anthocyanin-PS gel then sprayed it with pH solution.

Conclusions

This study has achieved an evolution in 3D food printing to 4D food printing, where a four-dimensional food product with health promotion properties was fabricated by printing a 3D food product which changed its color over time to an attractive color when exposed to an external stimulus or an internal stimulus from another part inside the product. Moreover, we studied the effect of adding different concentrations of PS (7.5, 10, 12.5, and 15 g) and anthocyanin (0.1%, 0.15%, and 0.2%) on the color intensity of 3D printed anthocyanin-PS gel after spraying with different pH solutions (pH 2, 2.5, 3, 3.5, 4, 4.5, and 5). The study has also revealed that the color intensity of 3D printed anthocyanin-PS gel before and after treatment with pH solutions decreased with the increasing of PS concentration. On the other hand, as expected, the color intensity of 3D printed anthocyanin-PS gel before and after treatment with pH solutions increased when anthocyanin concentration increased. The results also indicated that pH samples 2, 2.5, 3, and 3.5 showed significant differences in color after treatment compared to control samples, regardless of the concentrations of PS and anthocyanin. However, pH samples 4, 4.5, and 5 did not show any visible differences in color after treatment compared to control samples. The information obtained from this study is very important for the food industry or additive manufacturing technology to fabricate a 3D healthy food product with attractive colors that satisfy consumer acceptance.