In medical imaging, low-contrast chest X-ray (CXR) images may fail to provide adequate information for accurate visual interpretation and disease diagnosis. Conventional contrast enhancement techniques, such as histogram equalization, often introduce intensity shifts and loss of fine details. This study presents an advanced Exposure Region-Based Modified Adaptive Histogram Equalization (ERBMAHE) method, further optimized using Particle Swarm Optimization (PSO) to enhance contrast, preserve brightness, and strengthen fine details. The ERBMAHE method segments CXR images into underexposed, well-exposed, and overexposed regions using the 9IEC algorithm. The well-exposed region is further divided, generating five histograms. Each region undergoes adaptive contrast enhancement via a novel weighted probability density function (PDF) and power-law transformation to ensure balanced enhancement across different exposure levels. The PSO algorithm is then employed to optimize power-law parameters, further refining contrast enhancement and illumination uniformity while maintaining the natural appearance of medical images. The PSO-ERBMAHE method was tested on 600 Kaggle CXR images and compared against six state-of-the-art techniques. It achieved a superior peak signal-to-noise ratio (PSNR = 31.10 dB), entropy (7.48), feature similarity index (FSIM = 0.98), tenengrad function (TEN = 0.19), quality-aware relative contrast measure (QRCM = 0.10), and contrast ratio, while maintaining a low absolute mean brightness error (AMBE = 0.10). The method effectively enhanced image contrast while preserving brightness and visual quality, as confirmed by medical expert evaluations. The proposed PSO-ERBMAHE method delivers high-quality contrast enhancement in medical imaging, ensuring better visibility of critical anatomical features. By strengthening fine details, maintaining mean brightness, and improving computational efficiency, this technique enhances disease examination and diagnosis, reducing misinterpretation risks and improving clinical decision-making.