Method of compressing a digital image signal in which a first quantization
step set, which is unique for a given segment, is determined so that the
number of bits needed to encode the quantized data corresponding to this
segment is greater than a target value. This first quantization step set
then being modified, as a priority, for the blocks of the segment for
which the gain, in the course of this modification, on the reduction of
the number of bits needed to encode the quantized data corresponding to
the segment to which it belongs, is the highest. This modification is
carried out, on as many blocks as is necessary for the number of bits of
this segment to be less than or equal to the target value. Device to
implement this method.