Improving the quality of medical images is crucial for accurate clinical diagnosis; however, medical images are often disrupted by various types of noise, posing challenges to the reliability and diagnostic accuracy of the images. This study aims to enhance the Black Widow optimization algorithm and apply it to the task of denoising medical images to improve both the quality of medical images and the accuracy of diagnostic results. By introducing Tent mapping, we refined the Black Widow optimization algorithm to better adapt to the complex features of medical images. The algorithm's denoising capabilities for various types of noise were enhanced through the combination of multiple filters, all without the need for training each time to achieve preset goals. Simulation results, based on processing a dataset containing 1588 images with Gaussian, salt-and-pepper, Poisson, and speckle noise, demonstrated a reduction in Mean Squared Error (MSE) by 0.439, an increase in Peak Signal-to-Noise Ratio (PSNR) by 4.315, an improvement in Structural Similarity Index (SSIM) by 0.132, an enhancement in Edge-to-Noise Ratio (ENL) by 0.402, and an increase in Edge Preservation Index (EPI) by 0.614. Simulation experiments verified that the proposed algorithm has a certain advantage in terms of computational efficiency. The improvement, incorporating Tent mapping and a combination of multiple filters, successfully elevated the performance of the Black Widow algorithm in medical image denoising, providing an effective solution for enhancing medical image quality and diagnostic accuracy.