Image segmentation is crucial for early identification and diagnosis of crop diseases in agriculture. It helps identify disease areas and characteristics, laying the groundwork for disease diagnosis and treatment. However, color image thresholding segmentation method faces challenges in finding the optimal threshold as the number of thresholds increases, which affects segmentation quality. In this paper, a modified snake optimizer (MSO) is proposed to address the color image thresholding segmentation problem using Kapur's entropy as the objective function. MSO incorporates a dynamic adaptive parameter adjustment method. The improved global position update formula introduces guidance from the optimal individual and disturbance from random individuals, effectively achieving a balance between global and local search capabilities. A dynamic parameter adjustment method is added to accelerate convergence speed during snake movement to food. Le<acute accent>vy flight is introduced to the Flight mode to help the algorithm escape local extremums. A balancing strategy is implemented in the Mating mode, incorporating guidance from the optimal individual and information exchange between sub-populations, enabling balanced exploration and local exploitation capabilities. The hill-climbing jump operation for the optimal individual is added to help the algorithm overcome local stagnation. The proposed MSO is evaluated on CEC 2017 test functions and color test images, and the obtained results are compared with other segmentation methods and other intelligent optimization algorithms. The results demonstrate that MSO exhibits stable and excellent performance in both complex global optimization problems and color image thresholding segmentation problems. Finally, MSO is applied to segment rice disease images, and the results reveal significantly better segmentation performance compared to other algorithms. MSO shows great potential in solving the thresholding segmentation problem for agricultural disease images, thereby assisting in the accurate identification, diagnosis, and treatment of agricultural diseases and insect pests.