The invention relates to a method and an apparatus for encoding and/or decoding digital images, wherein said encoding apparatus (1100) comprises processing means (1110) configured for determining weights of a graph related to an image by minimizing a cost function, transforming said weights through a graph Fourier transform, quantizing the transformed weights, computing transformed coefficients through a graph Fourier transform of a graph having said the transformed weights as weights, de-quantizing the quantized transformed weights, computing a reconstructed image through an inverse graph Fourier transform on the basis of the de-quantized transformed weights, computing a distortion cost on the basis of the reconstructed image and the original image, generating a final encoded image on the basis of said distortion cost.