Using a 4-neighbor template to perform the nonlocal prediction on the index map is one of typical palette coding techniques. By analyzing the experimental results, it is found that one 4-neighbor template usually has a large number of interference templates and cannot effectively capture the color transition features in the edges’ anti-aliasing area. Therefore, a 2-neighbor template is proposed which includes four subtemplates to represent particular color transition modes of the foreground objects and the text edges at their upper left corners, lower left corners, upper right corners, as well as lower right corners. Meanwhile, the template prediction is further modeled into a transition probability that can be implemented by table lookup operations. An index map prediction method is further addressed using the 2-neighbor joint transition probability. Experimental results show that the prediction accuracy of the proposed method is 97.70%, which is separately 4.50% and 2.27% higher than that of the multi-stage prediction (MSP) method and that of the local directional prediction (LDP) method. It is especially suitable for the complex screen content coding with a large number of characters and computer-generated geometrical primitives. Moreover, the computational complexity of the proposed method is equivalent to that of the LDP method, and obviously lower than that of the MSP. The proposed method can be applied into the palette-index map based screen content predictive coding with high real-time demand.