Two new techniques for the compression of 2D and 3D medical images are proposed in the paper. Both algorithms are based on DCT transforms and the aim is to ensure a nearly lossless image transmission and storage with a compression rate able to reduce significantly the amount of data. The first technique, used for the storage of 2D medical images (microscope, radiographic, x-ray images, ultrasonic images, computer tomograph sections) is based on the extraction of a `region of interest' in the original image. In fact, in most situations, only a limited region of the medical image is interesting for diagnosis. For compression, a direct DCT is applied on the original image, preserving a different number of coefficients inside and outside the region of interest (must be higher inside the region). The compression ratio obtained with this method depends on the size of the selected region and on the number of DCT coefficients preserved, ranging from 4 to 20. The second technique is based on the correlation existing between contiguous axial sections obtained from the CT. The 3D volume data is compressed using an original axial section and the difference images between successive sections. The advantage of this method consists in reducing the number of DCT coefficients necessary for a nearly lossless compression of the difference images. The compression ratio obtained ranges between 6 nd 10, without significant losses in the image quality.