將小圖蓋印到大圖上的快速腳本
#!/usr/bin/php
<?php
// <wallace@wallacelau.com>
//實例化一個新的 Gmagick 物件
$imgMain = new Gmagick('Torso_F.tiff');
// 取得影像寬度
$width = (int) ($imgMain->getimagewidth() /2) - 150;
//實例化一個條碼影像 Gmagick 物件
$imgBarcode = new Gmagick('barcode.jpeg');
//將條碼蓋印在主影像上
$imgMain->compositeimage($imgBarcode, 1, $width, 150);
//將目前狀態的影像寫入檔案
$imgMain->write('withBarcode.tiff');
?>