Anthocyanins are widely found in plants and have significant functions. The accurate detection and quantitative assessment of anthocyanin content are essential to assess its functions. The anthocyanin content in plant tissues is typically quantified by wet chemistry and spectroscopic techniques. However, these methods are time-consuming, labor-intensive, tedious, expensive, destructive, or require expensive equipment. Digital photography is a fast, economical, efficient, reliable, and non-invasive method for estimating plant pigment content. This study examined the anthocyanin content of Rosa chinensis petals using digital images, a back-propagation neural network (BPNN), and the random forest (RF) algorithm. The objective was to determine whether using RGB indices and BPNN and RF algorithms to accurately predict the anthocyanin content of R. chinensis petals is feasible. The anthocyanin content ranged from 0.832 to 4.549 µmol g−1 for 168 samples. Most RGB indices were strongly correlated with the anthocyanin content. The coefficient of determination (R2) and the ratio of performance to deviation (RPD) of the BPNN and RF models exceeded 0.75 and 2.00, respectively, indicating the high accuracy of both models in predicting the anthocyanin content of R. chinensis petals using RGB indices. The RF model had higher R2 and RPD values, and lower root mean square error (RMSE) and mean absolute error (MAE) values than the BPNN, indicating that it outperformed the BPNN model. This study provides an alternative method for determining the anthocyanin content of flowers.