This paper proposes a novel adaptive image steganography method combining matrix coding, which can achieve better visual quality according to the given embedding rate compared with other existing schemes. The embedding processes are divided into two phases: preparation and implementation. In the preparation phase, all 128 combinations of a 7-bit binary number are classified into eight groups by a parity check matrix based on matrix coding. Thus, each group corresponds to an octal number, and contains 16 candidates. Correspondingly, all pixels of a cover image are classified into three categories by a predefined embedding rate level: low, middle, and high. In the implementation phase, each pixel in the high level can be embedded with 3 bits by substituting its 7 LSBs (Least Significant Bit) using a close candidate from the group determined by the to-be-embedded 3 bits. For the middle level, pixel pairs are used to hide 3-bit data by substituting its (3, 4) LSBs combination using a close candidate form the group determined by the to-be-embedded 3 bits. For pixels in the low level, a triple pixel combination is used to embed 3-bit data by substituting its (2, 2, 3) LSBs combination using a close candidate form the group determined by the to-be-embedded 3 bits. The experimental results indicate that the proposed scheme is optimal compared to other existing matrix-coding data hiding schemes in terms of visual quality, while providing an identical embedding capacity. INDEX TERMS Adaptive data hiding, steganography, matrix coding, optimal visual quality.