Watimage Classes Usage

Reading time ~3 minutes

Here’s an explanation of each class contained in Watimage (click the class name for detailed information):

  • Image: the core Image class.
  • Watermark: for watermarking Images.
  • Watimage: a merge between Watermark and Image. Mainly used for backward compatibility.
  • Normalize: a static class used internally for getting parameters in as many ways as possible.
  • Exception: enter here to know more about Watimage exceptions.

← Go back to Watimage Usage

About the header image

For the header image the following code has been executed:

$image = new Image('freeparty-back.jpg');
$image
    ->contrast(-5)
    ->brightness(-60)
    ->colorize(['r' => 100, 'g' => 70, 'b' => 50, 'a' => 0])
    ->brightness(-35)
    ->contrast(-5)
    ->colorize(['r' => 0, 'g' => 5, 'b' => 15, 'a' => 0])
    ->vignette(.1)
    ->generate()
;

Both the image and the original can be found under gh-pages branch, inside images folder.