The Nonsymmetry and Antipacking Model (NAM) is suitable for the representation of image patterns, audio patterns, video patterns, and text patterns, and it is a general pattern representation model. Image representation is an important issue in computer graphics, computer vision, robotics, image processing and pattern recognition. A representation method of gray images based on NAM with Triangles and Squares, which is called NAMTS representation method, is proposed in this paper. Also, a concrete algorithm of the NAMTS for gray images is presented and the storage structure and total data amount of the proposed algorithm are analyzed in detail. By comparing the algorithm of the NAMTS with that of the classic linear quadtrees, the theoretical and experimental results show that the former is obviously superior to the latter with respect to the numbers of subpatterns or nodes and the data storagespace, and therefore it is a better method to represent gray images.