The purpose of this research is to explore irreversible data hiding techniques in the spatial domain. It combines the adaptive A2MLSB (Adaptive Modified Least Significant Bit Replacement) data hiding method with the Modified Median Edge Detection (MMED) method that has better edge pixel prediction effects. Finally, using the optimal pixel adjustment method for pixel tuning, a data hiding algorithm is designed that can effectively increase the payload of secret messages while maintaining the basic grayscale image carrier quality. In the data hiding method of this research, with the threshold value T = 240, k = 2, 3, 4 for A2MLSB and k = 4, 5 for MMED, the average payloads for testing on 8 images including Lena are 2.7 bpp, 3.42 bpp, and 4.25 bpp, respectively; the average PSNR values are 33.87 dB, 33.18 dB, and 30.64 dB, respectively. After extensive testing, the average payload is 4.25 bpp, and the average PSNR value is 30.18 dB. The stego-images after data hiding are imperceptible to the human eye. Therefore, the data hiding method proposed in this research meets the requirements of imperceptibility and high payload for information hiding and has a better payload than other scholars' methods. Regarding security analysis, the proposed technique has been verified to resist the RS steganalysis and pixel difference histogram analysis techniques.