phMagick code samples

These are the code examples available for phMagick

Browse them, read the code, see the result of each code block, and have fun

If you have questions ot suggestions just drop us a line

Creating Watermarks


Watermarks are easy to create, this code will overlay an image on
top of another

Code:

        $phMagick = new \phMagick\Core\Runner();
        $action = new \phMagick\Action\Watermark($this->originalFile, $this->newFile);

        // transparency of the watermark
        $action->setTransparency(70);

        // location of the watermark
        $action->setGravity('center');

        // watermark image (the image to overlay)
        $action->setWatermarkImage('data/watermark.png');

        $phMagick->run($action);