Introduction

Cellulitis is a deep dermal and subcutaneous tissue infection primarily caused by Group A beta-hemolytic streptococci and Staphylococcus aureus. It is characterized by widespread erythema, edema, and induration, most commonly affecting the lower extremities1,2. Cellulitis is typically diagnosed clinically based on history and physical examination, as microbiological diagnosis is often difficult due to the poor sensitivity of culture specimens3. In typical cases, initial antibiotic treatment targeting these pathogens is sufficient. However, dermatologists occasionally encounter cases that are resistant to first-line therapy and require additional treatment. Despite the high prevalence of cellulitis, there is limited evidence to guide physicians through differential diagnosis and therapeutic algorithms, making it challenging to ensure appropriate and timely management4,5.

Ultrasonography, computed tomography (CT), magnetic resonance imaging (MRI), and blood tests are commonly used to aid in the differential diagnosis and the assessment of treatment efficacy in cellulitis6,7,8. Additionally, changes in lesion color serve as important indicators of the treatment response. However, color assessment is typically based on the clinician’s subjective visual evaluation, which may not always align with the patient’s perception. This discrepancy can create obstacles in treatment decision-making. Therefore, an objective method to evaluate the severity of cellulitis and monitor treatment response is necessary for more effective management.

In dermatology, digital image analysis has been widely studied for diagnosing and managing skin tumors and malignancies such as melanoma9,10,11,12. Recent advancements in digital imaging and color analysis techniques hold promise for improving the accuracy and reliability of cellulitis assessment, although their application in this context remains underexplored. Thus, our objective was to develop a digital imaging system to measure quantitatively and analyze color changes in cellulitis lesions following treatment. Furthermore, we documented the color changes observed in successfully treated cases to establish criteria for determining treatment success. These criteria could help clinicians decide whether to continue initial treatment, reconsider the diagnosis, or implement additional interventions. By incorporating digital analysis, this approach may enhance the accuracy and reliability of clinical assessments, ultimately improving treatment outcomes for cellulitis.

Results

Patient characteristics

In this study, we analyzed 34 Japanese patients (20 men and 14 women) diagnosed with cellulitis. The characteristics of these patients are summarized in Table 1. Their mean age was 73.6 ± 9.4 years (mean ± standard deviation [SD]). Medical histories included edema in 18 patients (52.9%), thrombosis in 12 (35.3%), diabetes mellitus in 11 (32.4%), prior cellulitis in 7 (20.6%), rheumatoid arthritis in 4 (11.8%), and chronic venous insufficiency in 3 (8.8%). Before treatment, the mean white blood cell (WBC) count was 11.0 ± 6.0 × 103/µL, and the mean C-reactive protein (CRP) level was 10.7 ± 9.4 mg/dL. The mean treatment duration was 23.2 ± 23.9 days. At the initial visit (Day 1), the mean RGB values of the cellulitis lesions were as follows:

Table 1 Clinical characteristics of the patients.
  • R (Red): 190.9 ± 26.7 (range: 150.7–252.3).

  • G (Green): 115.6 ± 29.2 (range: 66.0–170.3).

  • B (Blue): 91.8 ± 27.3 (range: 44.0–147.7).

Increase in B and G values of lesions after treatment

We first analyzed the RGB values of cellulitis lesions in all patients following treatment. The mean R value of the lesion remained relatively unchanged over time (Fig. 1a). By contrast, the mean G and B values of the lesions increased after treatment. These values were as follows:

Fig. 1
figure 1

Changes in the RGB values of the lesion before and after treatment in all patients. (a) Changes in the R value. (b) Changes in the G value. (c) Changes in the B value. (d)Changes in the ratios relative to day 1. *P < 0.05, **P < 0.01. ns, not significant.

  • Day 3: G = 119.6 ± 29.7 (range: 69.3–163.3), B = 94.3 ± 29.5 (range: 47.3–159.3).

  • Day 7: G = 128.9 ± 23.9 (range: 81.7–170.3), B = 101.6 ± 23.5 (range: 61.0–140.3).

  • Day 14: G = 135.7 ± 25.6 (range: 77.0–179.0), B = 105.5 ± 23.4 (range: 54.3–136.7).

Compared with the baseline values on day 1, there was a statistically significant increase in G and B values by day 14 (P < 0.001 and P = 0.007, respectively) (Fig. 1b, c). In contrast, the RGB values of normal skin remained stable throughout the study period (Fig. S1), indicating that the observed increases in lesion G and B values reflected true treatment response rather than fluctuations in imaging conditions. The changes in the ratio of each RGB value in the lesion relative to day 1 are shown in Fig. 1d.

Color of lesions approached that of normal skin due to increase in B and G values after treatment

The observed increases in G and B values after treatment suggested that the color of the lesion was approaching that of normal skin. To investigate this further, we analyzed the distance between the lesion and normal skin in terms of RGB values. The R value distance remained relatively unchanged after treatment, measuring 21.4 ± 15.4 (range: 0.67–41.3) on day 1 before treatment, with no significant difference observed over time (Fig. 2a). By contrast, the mean G and B distances tended to decrease following treatment:

Fig. 2
figure 2

Changes in the distance between the lesion and the normal skin in terms of RGB values before and after treatment in all patients. (a) Changes in the R distance. (b) Changes in the G distance. (c) Changes in the B distance. (d) Changes in the ratios relative to day 1 of the R, G, and B distance. (e) Changes in the RGB distance. (F) Changes in the ratio relative to day 1 of the RGB distance. *P < 0.05, **P < 0.01, ***P < 0.001. ns, not significant.

  • Day 1: G distance = 44.8 ± 21.7 (range: 4.0–99.3), B distance = 37.5 ± 18.8 (range: 1.0–90.3).

  • Day 7: G distance = 29.9 ± 16.0 (range: 2.3–76.3), B distance = 26.4 ± 13.4 (range: 6.0–56.7).

  • Day 14: G distance = 27.7 ± 17.1 (range: 5.7–69.3), B distance = 27.7 ± 19.2 (range: 2.7–59.7).

The reductions in G and B distances became statistically significant from day 7 onward compared with baseline (Day 7: P = 0.003 and 0.016; Day 14: P = 0.001 and 0.032, respectively) (Fig. 2b, c). The changes in the ratio of each RGB value relative to day 1 are shown in Fig. 2d.

Before treatment, the RGB distance was 64.3 ± 28.5 (range: 11.3–143.6). Following treatment, this distance gradually decreased as follows:

  • Day 3: 53.7 ± 31.3 (range: 12.3–152.3).

  • Day 7: 43.4 ± 23.4 (range: 7.3–112.3).

  • Day 14: 43.3 ± 26.7 (range: 15.2–97.5).

The reduction in the RGB distance became statistically significant from day 3 onward (Day 3: P = 0.048; Day 7: P = 0.001; Day 14: P = 0.002, respectively) (Fig. 2e). The changes in the ratio of RGB distance relative to day 1 are shown in Fig. 2f.

We next examined the association between RGB distance and systemic inflammatory markers. RGB distance in cellulitis was positively correlated with serum WBC counts and CRP levels. These findings suggest that treatment correlated with a decrease in RGB distance, reflecting improvements in inflammation caused by bacterial infection (Fig. S2).

Changes in RGB value of lesions after treatment in cases with favorable clinical outcome

In addition, we analyzed a subset of patients (n = 13) who were subjectively assessed by dermatologists as having favorable clinical outcomes using the Investigator’s Global Assessment (IGA) score (Group A). In contrast, patients with delayed clinical improvement were classified as Group B (n = 21). The clinical symptoms of Group A and the RGB distance ratio for both groups are shown in Fig. 3a. Notably, swelling and redness of the feet in Group A showed visible improvement by day 7 of treatment.

Fig. 3
figure 3

Clinical images and RGB distance ratio analyses in cellulitis patients, with receiver operating characteristic (ROC) curves for treatment response. (a) Skin manifestations of a representative patient in Group A and transition of the RGB distance ratio relative to day 1 for Group A and Group B. Blue dots: RGB distance ratio relative to day 1 for individual patients in Group A at each time point. Red dots: RGB distance ratio relative to day 1 for individual patients in Group B at each time point. Purple line: line connecting the optimal cut-off values derived from ROC analyses. (b) ROC curve of the RGB distance ratio on day 3 (AUC = 0.908; 95% CI, 0.77–1.00; optimal cut-off = 0.62; sensitivity = 0.83; specificity = 1.00). (c) ROC curve of the RGB distance ratio on day 7 (AUC = 0.788; 95% CI, 0.60–0.98; optimal cut-off = 0.48; sensitivity = 0.60; specificity = 1.00). (d) ROC curve of the RGB distance ratio on day 14 (AUC = 0.675; 95% CI, 0.38–0.97; optimal cut-off = 0.49; sensitivity = 0.57; specificity = 0.91).

By day 14 of treatment, the R values in Group A remained unchanged (196.8 ± 27.7 to 191.9 ± 16.9), whereas the G values increased significantly from 116.0 ± 31.6 to 138.4 ± 28.0 (P < 0.001), and the B values increased from 93.0 ± 27.3 to 112.5 ± 29.0 (P = 0.050) (Fig. 4a–c). Additionally, the RGB distance significantly decreased from 66.0 ± 26.7 (range: 33.7–141.6) to 35.4 ± 14.2 (range: 15.2–61.5) (P < 0.001) (Fig. 4d). The RGB distance ratio showed a consistent decrease immediately after treatment in Group A.

Fig. 4
figure 4

Changes in the RGB values and the RGB distance between the lesion and normal skin before and after treatment in favorable clinical outcomes. (a) Changes in the R value. (b) Changes in the G value. (c) Changes in the B value. (d) Changes in the RGB distance.*P < 0.05, ****P < 0.0001. ns, not significant.

ROC analysis showed the utility of RGB distance ratio for evaluating treatment efficacy

Further, receiver operating characteristic (ROC) analyses of the RGB distance ratio at days 3, 7, and 14 were conducted using IGA-defined outcomes in these two groups as the reference standard to determine optimal cut-off values for evaluating treatment efficacy. These analyses yielded areas under the curve (AUCs) of 0.908 (95% confidence interval [CI], 0.77–1.00; P = 0.001) on day 3, 0.788 (95% CI, 0.60–0.98; P = 0.015) on day 7, and 0.675 (95% CI, 0.38–0.97; P = 0.22) on day 14, respectively. The optimal cut-off values were 0.62 on day 3 (sensitivity 0.83, specificity 1.00), 0.48 on day 7 (sensitivity 0.60, specificity 1.00), and 0.49 on day 14 (sensitivity 0.57, specificity 0.91) (Fig. 3b–d). These results indicate that the RGB distance ratio was useful for evaluating treatment efficacy from as early as day 3 in the treatment course.

Edema identified as a factor delaying skin color improvement in cellulitis treatment

A comparative analysis was then conducted between these two groups (Table 1).

The R, G and B values of the lesions were not significantly different between Group A and Group B at the initial examination (R: 196.8 ± 27.7 vs. 187.8 ± 23.1, G: 116.0 ± 31.6 vs. 116.1 ± 26.6, B: 93.0 ± 27.3 vs. 91.7 ± 25.8). Additionally, the RGB distance was greater in Group A (66.0 ± 26.7 vs. 63.2 ± 29.5), although these differences were not statistically significant (P = 0.376, 0.896, 0.868, and 0.972, respectively). However, the RGB distance was significantly smaller in Group A than in Group B at day 3 and day 7 (Day 3: 41.0 ± 23.1 vs. 68.1 ± 35.6, P = 0.025; Day 7: 28.0 ± 15.3 vs. 52.6 ± 22.9, P = 0.004), but no significant difference was observed at day 14. Furthermore, a history of edema was significantly more frequent in Group B than in Group A (14/21, 66.7% vs. 4/13, 30.8%; P = 0.042). These findings suggest that while the initial lesion color may not reliably predict treatment response, patients who have cellulitis with edema may experience delayed improvement in lesion color following treatment.

Discussion

In this study, we aimed to develop the first image analysis system using RGB values to assess objectively the treatment efficacy of cellulitis. This digital system evaluated treatment response by calculating the RGB color distance between the lesion and normal skin, accounting for individual variations in skin tone.

Our findings showed that, as treatment progressed, the R value remained unchanged—contrary to our initial expectation that it would decrease. By contrast, the G and B values of the cellulitis lesions increased. As a result, the RGB distance significantly decreased after day 3 of treatment compared to baseline. A reduction in the RGB distance indicates a decreasing color difference between the lesion and normal skin, signifying successful treatment. These changes in RGB values are likely attributable to the absorption and scattering of light by melanin and hemoglobin, the major chromophores in human skin13. Oxygenated hemoglobin exhibits absorption peaks at 418 nm, 542 nm, and 577 nm; deoxygenated hemoglobin at 430 nm and 555 nm; and melanin at approximately 335 nm14. The absorption of these chromophores decreases with increasing wavelength. Therefore, the shorter wavelengths corresponding to the G and B channels are absorbed more readily by melanin and hemoglobin than the longer wavelength corresponding to the R channel. In cellulitis, inflammation increases vascular permeability and local blood flow, leading to tissue edema, which enhances the absorption of the G and B wavelengths mediated by hemoglobin. Improvement of inflammation with successful treatment leads to normalization of vascular reactivity, reducing absorption at these wavelengths and restoring G and B values.

Our results revealed that in the group of patients showing favorable clinical outcomes (Group A), the absolute RGB distance was significantly smaller from day 3 onward compared to the group of patients with delayed clinical improvement (Group B), with edema being significantly more prevalent in Group B. This suggests that the color difference between the lesion and normal skin decreased earlier in the favorable group. Furthermore, ROC analyses using the RGB distance ratio relative to day 1 demonstrated high accuracy at day 3 (AUC = 0.908, cut-off = 0.62, sensitivity 0.83, specificity 1.00) and day 7 (AUC = 0.788, cut-off = 0.48, sensitivity 0.60, specificity 1.00), whereas predictive ability declined by day 14 (AUC = 0.675, cut-off = 0.49, sensitivity 0.57, specificity 0.91).

These findings suggest that RGB distance provides a useful criterion for evaluating treatment efficacy in cellulitis, particularly during the early treatment phase up to day 7. In addition, these results highlight the importance of properly assessing edema as a factor that may contribute to delayed improvement in skin color during the healing process.

The prevalence of cellulitis and the criteria for hospitalization vary widely across regions and institutions. In the United States, the incidence and associated healthcare costs of cellulitis have increased over the past several decades15. Each year, cellulitis accounts for approximately 2.3 million emergency room visits, with 13.9% to 17.0% of diagnosed patients requiring hospitalization. Cellulitis-related hospitalizations represent 10% of all infectious disease-related hospital admissions, with associated costs exceeding $7 billion3,16. Additionally, lower leg edema is a known risk factor for cellulitis and contributes to an increased risk of recurrence17,18,19. Traditionally, the evaluation of treatment efficacy for cellulitis has relied on subjective visual evaluation. Imaging tests such as ultrasound, CT, and MRI have been used as adjuncts but are costly and continuous monitoring is impractical. In contrast, our system is non-invasive, easily performed using a standard digital camera, and low-cost. Furthermore, this system provides objective evaluation of treatment efficacy at various points during therapy. If the RGB distance does not decrease to approximately half of the baseline value by day 7, clinicians may consider adjusting the therapeutic strategy, reassessing the diagnosis of cellulitis, or implementing more intensive interventions in cases complicated by edema. This information can help optimize treatment strategies. Appropriate evaluation and management of cellulitis are crucial to preventing recurrence and reducing healthcare costs.

In recent years, several studies have highlighted the utility of machine learning (ML) and deep learning (DL) approaches in dermatology20,21. Chen et al. developed an ML-based model using clinical and laboratory data to predict sepsis progression in cellulitis, demonstrating high accuracy and robustness22. Building on these findings, incorporating objective image-derived indices such as RGB distance into ML or DL models may further improve the evaluation of treatment efficacy in cellulitis and provide a more reliable strategy for monitoring the clinical course.

This study has several limitations. First, it was conducted at two medical centers within a tertiary care setting. Second, although we minimized the influence of ambient light by using an external flash, a gray color card, and a black background, its remaining effects could not be completely excluded. Third, due to the poor sensitivity of culture specimens, microbiological testing was not performed in all cases, and the causative microorganisms were not systematically identified. Different pathogens can exhibit distinct clinical features—for example, purulent infections are often associated with Staphylococcus aureus and culture-negative cellulitis is frequently caused by Streptococcus species—so the patterns of RGB changes may also differ depending on the pathogen23,24. Nevertheless, because the RGB distance correlated with WBC counts and CRP levels, both systemic inflammatory markers of bacterial infection, this parameter is considered to be broadly useful irrespective of the pathogen. Fourth, the study population was relatively small (n = 34) and consisted exclusively of Japanese patients, predominantly with Fitzpatrick skin types III–IV. Although our system detected color differences between lesions and normal skin in this population, its applicability to other racial groups and skin types has not yet been established. Future studies are essential to validate the generalizability of this method in larger, multi-center cohorts across different racial groups and skin tones.

In conclusion, this study suggests that RGB image analysis of cellulitis lesions can serve as an objective standard for evaluating treatment efficacy, aiding in the development of appropriate treatment plans. Additionally, we believe this analysis system has the potential to be applied to the assessment of other skin diseases characterized by color changes.

Materials and methods

This study was approved by the ethics committee of Tokyo Women’s Medical University (Approval No. 2022-0076) and was conducted in accordance with the principles of the Declaration of Helsinki.

Patients

Patients diagnosed with cellulitis by specialist dermatologists were enrolled in the study at Tokyo Women’s Medical University Hospital or Tokyo Women’s Medical University Yachiyo Medical Center between November 2022 and July 2025. All patients received initial empirical therapy with oral or intravenous antibiotics targeting methicillin-sensitive Staphylococcus aureus, primarily first-generation cephalosporins such as cefazolin or cephalexin, in accordance with standard guidelines25. In cases of severe edema, elastic bandages or compression stockings were applied. Patients with osteomyelitis, pressure ulcer infections, or necrotizing fasciitis were excluded from the study.

Image acquisition

Clinical images of the patients’ cellulitis lesions, along with the surrounding normal skin, were captured after obtaining written informed consent. Investigators used a digital single-lens reflex camera (Canon EOS R10; Canon, Tokyo, Japan) equipped with an external flash, which served as the primary illumination source under indoor conditions to minimize the influence of ambient light on RGB values. An 18% professional neutral gray color card (18% Gray Card; Anwenk, Shenzhen, China) was placed near the lesion to standardize the color calibration26,27. A black cloth was used as the background to reduce reflection and color interference. Images were taken at five time points: before treatment, 3 days after treatment, 7 days after treatment, 14 days after treatment, and at the end of treatment with a permissible variation of ± 3 days. All images were taken by three dermatologists trained in standardized dermatological photography. For each lesion, the camera was held parallel to the lesion surface and perpendicular to the skin surface, and two to three images were taken from a fixed distance of approximately 60 cm.

Image analysis using the RGB skin analyzer

We developed the “RGB skin analyzer,” software to evaluate skin color based on RGB values. The RGB color model is the most fundamental and widely used method for displaying color images28. This model can be represented using Cartesian coordinates within a cubic space (Fig. 5), where the three primary colors—red, green, and blue—occupy three vertices. In this system, the intensity of each color is quantified on a scale from 0 to 255. For example, pure red is represented as (255, 0, 0), where the green and blue channels have zero intensity. Similarly, pure green and pure blue are represented as (0, 255, 0) and (0, 0, 255), respectively. Various combinations of these three components generate specific colors within the RGB model28. Our image analysis system first calibrates the RGB parameters of the gray standard plate in each acquired image to (128, 128, 128). It then adjusts the RGB values of the target areas based on the total correction applied to the gray standard plate, ensuring accurate and consistent color analysis.

Fig. 5
figure 5

The RGB model quantifies the intensity of each color (red, green, and blue) on a scale from 0 to 255, and can be presented using Cartesian coordinates in a cubic color space.

Using the RGB skin analyzer, we measured the RGB values at three points within the cellulitis lesion—specifically at the areas deemed by evaluators to be the reddest—and at three points on the surrounding normal skin. Each measurement area was 1 cm2 in size. The average RGB values of the three selected points within the lesion and the three points on normal skin were calculated separately, defining the RGB value for each respective area. Considering individual differences in skin color, each patient’s own normal skin was used as the control. To quantify the color tone of the cellulitis lesion, we calculated the RGB distance between the lesion and the normal skin using the following formula:

A decrease in the RGB distance indicates that the lesion color is becoming more similar to that of normal skin, suggesting an improvement in the condition.

Evaluation of treatment efficacy using the RGB skin analyzer

We performed image analysis using the RGB skin analyzer on clinical photographs from all cases. Day 1 was defined as the start of treatment. To evaluate efficacy, patients were divided into two groups according to the IGA score for redness and swelling on day 7 or 14, as evaluated by dermatologists with extensive experience in treating cellulitis. Group A comprised patients who achieved an IGA score of 0 or 1 (favorable outcome), and Group B comprised those who did not (delayed improvement). The RGB distance ratio relative to day 1 was calculated to assess temporal changes, and ROC analyses were performed using this IGA-based classification as the reference standard.

Correlation with systemic markers

In addition to clinical assessment, correlations with systemic inflammatory markers were analyzed. For patients with available laboratory data, WBC counts and CRP levels were collected at baseline, day 3, day 7, and day 14. Correlations between these systemic inflammatory markers and RGB distance values were analyzed using Spearman’s rank correlation coefficient.

Statistical analysis

Data analysis was conducted using GraphPad Prism 10 (GraphPad Software, San Diego, CA, USA). Results are expressed as mean ± standard deviation. Normality was assessed using the Shapiro–Wilk test. For repeated measures over time (day 1, 3, 7, and 14), mixed-effects analysis with Geisser–Greenhouse correction was used to assess changes in RGB values and RGB distance. Comparisons between Group A and Group B were performed using unpaired two-tailed Student’s t-test, Mann–Whitney U test, or chi-squared test, as appropriate.

ROC curves were calculated to evaluate the optimal cut-off values of the RGB distance ratio for predicting favorable treatment course. The cut-off value was determined by Youden’s index, and AUC was used to judge the prediction capabilities. A P value < 0.05 was considered statistically significant.