The graph Fourier transform (GFT)-adaptive to the signal structures of local pixel blocks-has recently been shown to be a good alternative to fixed transforms, e.g., the Discrete Cosine Transform (DCT), for image coding. However, the majority of proposed GFTs assume an underlying 4-connected graph structure with vertical and horizontal edges only. In this paper, we propose a design methodology to select more general sparse graph structures and edge weights, on which GFTs are defined for block-based coding. Specifically, we first cluster blocks via the Lloyd-Max algorithm based on their principal gradients, which are eigenvectors of the computed structure tensors. For each cluster a graph template with edges orthogonal to the principal gradient is designed. Finally, optimal edge weights are computed assuming each template is a graph describing the inter-pixel correlation in a Gaussian Markov Random Field (GMRF). Experimental results show that GFTs derived from our graph templates lead to sparser signal representations and fewer encoding bits than DCT for a set of natural test images.