src/mako/pixl/Image.php
public function watermark($file, $position = Image::WATERMARK_TOP_LEFT, $opacity = 100): Image
	{
		// Check if the image exists

		if(file_exists($file) === false)
		{
			throw new RuntimeException(vsprintf('The watermark image [ %s ] does not exist.', [$file]));
		}

		// Make sure that opacity is between 0 and 100

		$opacity = max(min((int) $opacity, 100), 0);

		// Add watermark to the image

		$this->processor->watermark($file, $position, $opacity);

		return $this;
	}
public function watermark($file, $position = Image::WATERMARK_TOP_LEFT, $opacity = 100): Image
	{
		// Check if the image exists

		if(file_exists($file) === false)
		{
			throw new RuntimeException(vsprintf('The watermark image [ %s ] does not exist.', [$file]));
		}

		// Make sure that opacity is between 0 and 100

		$opacity = max(min((int) $opacity, 100), 0);

		// Add watermark to the image

		$this->processor->watermark($file, $position, $opacity);

		return $this;
	}
public function watermark ( $ file , $ position = Image :: WATERMARK_TOP_LEFT , $ opacity = 100 ) : Image { // Check if the image exists if ( file_exists ( $ file ) === false ) { throw new RuntimeException ( vsprintf ( 'The watermark image [ %s ] does not exist.' , [ $ file ] ) ) ; } // Make sure that opacity is between 0 and 100 $ opacity = max ( min ( ( int ) $ opacity , 100 ) , 0 ) ; // Add watermark to the image $ this -> processor -> watermark ( $ file , $ position , $ opacity ) ; return $ this ; }
Adds a watermark to the image.

@param  string            $file     Path to the image file
@param  int               $position Position of the watermark
@param  int               $opacity  Opacity of the watermark in percent
@throws \RuntimeException
@return \mako\pixl\Image
Adds a watermark to the image .