To achieve higher compression ratios in medical images while preserving quality, a new fractal method is developed, examined, and tested in this paper. The basic idea of fractal image compression is to reduce the similarity redundancy by identifying a given image with the fixed-point of an appropriate partitioned iterated function system (PIFS), that consists of a set of contractive affine transformations. Since conventional PIFS models use only affine transformations to represent similarity for the whole image, the quality of the re-created images is quite limited in some cases. Because the grayscale in most images is dependent on location, it is not sufficient to describe the relationship using linear transforms when there are complex textures present. Effective interpolation polynomials should adapt to the nature of the underlying texture; that is the basis of the new method. The new fractal image-compression algorithm uses adaptive PIFS (APIFS), that is based on variants of affine transformations and lossless compression methods. Polynomials of various orders are used to represent adaptively the similarity of grayscale based on the local details of the image, and the contractive condition for the generalized transformation is shown to hold. In this approach, quadratic and linear models are applied adaptively to the contractive transformations. The variants of the affine transform are used where similarities can be identified, while lossless compression techniques are used for those local areas in which similar domains do not exist or cannot be found. Preliminary experiments indicate that the APIFS model has the potential to increase the useful compression ratio. Experiments with medical images indicate that this new algorithm can be extended to yield a compression ratio of about 30:1 without perceptible degradation.