Apparatus for encoding digital images, comprising - input means configured for acquiring at least a portion of at least an image (f) from a source, - output means configured for outputting at least a portion of an encoded image to a destination, - processing means configured for a) reading the at least the portion of the image (f), b) determining a Laplacian of a square grid graph associated to a Discrete Cosine Transform matrix able to transform the at least the portion of the image (f) from a spatial domain to a frequency domain, c) determining eigenvalues of the Laplacian with multiplicity greater than one, d) selecting for at least one of the eigenvalues determined at step c) a set of basis vectors of the DCT matrix that are eigenvectors of the Laplacian corresponding to the at least one eigenvalue, e) rotating the set of basis vectors by a rotation angle (θ), f) determining a rotated transform matrix (V') which has as basis vector the rotated set of basis vectors, g) computing transformed coefficients (f^) by transforming pixel values contained in the at least the portion of the image (f) from the spatial domain to the frequency domain by means of the rotated transform matrix (V'), and h) outputting, by means of the output means, the transformed coefficients (f^) to said destination, wherein the processing means are configured for - determining the rotation angle (θ) by selecting a rotation angle that minimizes or maximizes an objective function estimating a coding efficiency associated with the at least the portion of the image (f), or - performing intra frame coding by generating intra frame prediction information and determining the rotation angle (θ) on a basis of the intra frame prediction information. - input means configured for acquiring at least a portion of at least an image (f) from a source, - output means configured for outputting at least a portion of an encoded image to a destination, - processing means configured for a) reading the at least the portion of the image (f), b) determining a Laplacian of a square grid graph associated to a Discrete Cosine Transform matrix able to transform the at least the portion of the image (f) from a spatial domain to a frequency domain, c) determining eigenvalues of the Laplacian with multiplicity greater than one, d) selecting for at least one of the eigenvalues determined at step c) a set of basis vectors of the DCT matrix that are eigenvectors of the Laplacian corresponding to the at least one eigenvalue, e) rotating the set of basis vectors by a rotation angle (θ), f) determining a rotated transform matrix (V') which has as basis vector the rotated set of basis vectors, g) computing transformed coefficients (f^) by transforming pixel values contained in the at least the portion of the image (f) from the spatial domain to the frequency domain by means of the rotated transform matrix (V'), and h) outputting, by means of the output means, the transformed coefficients (f^) to said destination, wherein the processing means are configured for a) reading the at least the portion of the image (f), b) determining a Laplacian of a square grid graph associated to a Discrete Cosine Transform matrix able to transform the at least the portion of the image (f) from a spatial domain to a frequency domain, c) determining eigenvalues of the Laplacian with multiplicity greater than one, d) selecting for at least one of the eigenvalues determined at step c) a set of basis vectors of the DCT matrix that are eigenvectors of the Laplacian corresponding to the at least one eigenvalue, e) rotating the set of basis vectors by a rotation angle (θ), f) determining a rotated transform matrix (V') which has as basis vector the rotated set of basis vectors, g) computing transformed coefficients (f^) by transforming pixel values contained in the at least the portion of the image (f) from the spatial domain to the frequency domain by means of the rotated transform matrix (V'), and h) outputting, by means of the output means, the transformed coefficients (f^) to said destination, - determining the rotation angle (θ) by selecting a rotation angle that minimizes or maximizes an objective function estimating a coding efficiency associated with the at least the portion of the image (f), or - performing intra frame coding by generating intra frame prediction information and determining the rotation angle (θ) on a basis of the intra frame prediction information.