The NONE constant ignores the original image’s ratio.
Neither width and height are required.
If a dimension is not specified, the original dimension will be used.
If the new proportions differ from the original proportions, the image may be distorted and stretched.

Similar to the NONE constant, the TENSILE constant ignores the original image’s ratio.
Both width and height are required.
If the new proportions differ from the original proportions, the image may be distorted and stretched.

<?php$image=new\Phalcon\Image\Adapter\Gd("image.jpg");$watermark=new\Phalcon\Image\Adapter\Gd("me.jpg");// Put the watermark in the top left corner$offsetX=10;$offsetY=10;$opacity=70;$image->watermark($watermark,$offsetX,$offsetY,$opacity);$image->save("watermarked-image.jpg");

Of course, you can also manipulate the watermarked image before applying it to the main image:

<?php$image=new\Phalcon\Image\Adapter\Gd("image.jpg");$watermark=new\Phalcon\Image\Adapter\Gd("me.jpg");$watermark->resize(100,100);$watermark->rotate(90);$watermark->sharpen(5);// Put the watermark in the bottom right corner with a 10px margin$offsetX=($image->getWidth()-$watermark->getWidth()-10);$offsetY=($image->getHeight()-$watermark->getHeight()-10);$opacity=70;$image->watermark($watermark,$offsetX,$offsetY,$opacity);$image->save("watermarked-image.jpg");