• An improved slime mould algorithm (MGSMA) is proposed for image segmentation. • An effective multi-level image segmentation based on MGSMA is developed. • The performance of MGSMA is verified by comparing with some well-known peers. • MGSMA effectively optimizes segmentation process and improves segmentation results. First, this study develops an enhanced slime mould algorithm (MGSMA). The main idea is to combine the new movement strategy and Gaussian kernel probability strategy to improve the optimization performance of the original slime mould algorithm. These two tactics increase MGSMA's capacity to avoid being stuck in a local optimum and reduce the probability of delaying the convergence process. Second, by integrating non-local mean, 2D Kapur's entropy, and other relevant methodologies, a novel multi-level image segmentation (MLIS) model is developed based on the suggested MGSMA. To showcase MGSMA's performance, specific comparative tests based on IEEE CEC2014 are carried out, clearly showing that MGSMA is a swarm intelligence approach capable of jumping out of the local optimum and the convergence process does not willingly interrupt. To demonstrate that the MGSMA-based MLIS approach can provide high-quality segmentation results, it is compared to eight other comparable methods at both high and low thresholding levels, with some relevant experimental findings to back up its claims. As a consequence, there is no question that MGSMA is a high-performance swarm intelligence optimization approach and that the MGSMA-based MLIS method can provide high-quality segmentation results. The source codes of the SMA algorithm and latest updates are publicly available at https://aliasgharheidari.com/SMA.html .