The Discrete Cosine Transform (DCT) is widely used in lossy image and video compression schemes, e.g., JPEG and MPEG. In this paper, we show that the compression efficiency of the DCT is dependent on the edge directions within a block. In particular, higher compression ratios are achieved when edges are aligned with the image axes. To maximize compression for general images, we propose a rotated block DCT method. It consists of rotating each block, before applying the DCT, by an angle that aligns the edges, and rotating back the block in the decompression stage. We show how to compute the rotation angle and analyze two alternative block rotation approaches. Our experiments show that our method enables both a perceptual improvement and a PSNR increase of up to 2dB, compared with the standard DCT, for low and medium bit rates.