1. A method for compressing data, in particular images, by transform, in which method this data is projected onto a base of localized orthogonal or biorthogonal functions, and which method, to quantize each of the localized functions with a quantization step that enables an overall set rate R c to be satisfied, includes the following steps: a) a probability density model of coefficients in the form of a generalized Gaussian is associated with each subband, b) the parameters &agr; and &bgr; of this density model are estimated, while minimizing the relative entropy, or Kullback-Leibler distance, between this model and the empirical distribution of coefficients of each subband, and c) from this model, for each subband, an optimum quantization step is determined such that the rate allocated is distributed in the various subbands and such that the total distortion is minimal.