精慕HU
Bonzo提供的答案是正确的。PHP 的 Imagick 中的示例看起来非常相似。$image = new Imagick('rose:');$watermark = new Imagick('label:Hello World!');// The decoding process must "know" about the watermarks size, and starting// pixel offset.define('STEGANO_OFFSET', 64); // Secret offsetdefine('STEGANO_WIDTH', $watermark->getImageWidth());define('STEGANO_HEIGHT', $watermark->getImageHeight());$stegano = $image->steganoImage($watermark, STEGANO_OFFSET);$stegano->writeImage('output.png');要解码原始水印,请在读取文件之前定义隐藏图像的宽度、高度和偏移量。$decoded = new Imagick();$decoded->setSizeOffset(STEGANO_WIDTH, STEGANO_HEIGHT, STEGANO_OFFSET);$decoded->readImage('STEGANO:output.png');$decoded->writeImage('decoded.png');