<?php
 class phMagick_compose{ function watermark(phmagick $p, $watermarkImage, $gravity = 'center', $transparency = 50){ $cmd = $p->getBinary('composite'); $cmd .= ' -dissolve ' . $transparency ; $cmd .= ' -gravity ' . $gravity ; $cmd .= ' ' . $watermarkImage ; $cmd .= ' "' . $p->getSource() .'"' ; $cmd .= ' "' . $p->getDestination() .'"' ; $p->execute($cmd); $p->setSource($p->getDestination()); $p->setHistory($p->getDestination()); return $p ; } function tile(phmagick $p, $paths = null, $tileWidth = '', $tileHeight=1){ if( is_null($paths) ) { $paths = $p->getHistory(phMagickHistory::returnArray); } $cmd = $p->getBinary('montage'); $cmd .= ' -geometry x+0+0 -tile '.$tileWidth.'x'.$tileHeight.' '; $cmd .= implode(' ', $paths); $cmd .= ' "' . $p->getDestination() .'"' ; $p->execute($cmd); $p->setSource($p->getDestination()); $p->setHistory($p->getDestination()); return $p ; } function acquireFrame(phmagick $p, $file, $frames=0){ $cmd = $p->getBinary('convert'); $cmd .= ' "' . $file .'"['.$frames.']' ; $cmd .= ' "' . $p->getDestination().'"' ; $p->execute($cmd); $p->setSource($p->getDestination()); $p->setHistory($p->getDestination()); return $p ; } } ?>