提出通过对分块图像的DCT 系数进行动态范围压缩来改进传统的基于DCT 变换的图像自嵌入水印算法,并结合灰度变换函数与JPEG 标准量化表重新设计了DCT 系数码长分配表,大幅度提升了量化过程保留的图像频段范围,使水印图像在遭受篡改攻击后能较好地恢复;最后,给出了MATLAB 的算法实现。 关键词:DCT;水印;MATLAB;码长;动态压缩;自嵌入 Abstract: In this paper, a better scheme of self2embedding an image into itself is proposed by compressing the dynamic range of DCT coefficients , whose bit lengths are nicely chosen according to gray transforming function and standard JPEG quantization table. By this scheme , the image’s frequency segment is largely extended which could be saved, and the watermarking image tampered could be properly recovered . In addition ,the key algorithm, which comes true in MATLAB, is amply analyzed in this paper. Key words: DCT ; watermark; MATLAB; code length; dynamic compression; self2embedding