Type to search...


Gravity provides the part of the image we want to focus on.


You can specify multiple values; the most successful (executable) version is going to be the valid one (e.g.: if there is no face on the image, it will skip to the next one, if there is a next one specified).

  • with layers (over, under, text) it provides the anchor point of the paste. In this case, the x, y values should be interpreted s starting from the anchor points, and the positive values are always point towards the center.


  • faces*: including all faces; crop will be overwritten, so width and height will be disregarded
  • face*: the first detected face; crop will be overwritten, width and height will be disregarded
  • face:{N}*: the Nth detected face; crop will be overwritten, width and height will be disregarded
  • eyes*: including all eyes; crop will be overwritten, width and height will be disregarded
  • top-left, tl: upper left corner
  • top-right, tr: upper right corner
  • bottom-left, bl: lower left corner
  • bottom-right, br: lower right corner
  • left, l: center of left side
  • right, r: center of right side
  • bottom, b: center of bottom
  • top: center of upper part
  • center: center (default)
  • xy-center: center for X,Y points; the specification of x and y points are mandatory

*: beta version


  • This transformation does not have any limitations.



Find the face and focus on it

use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->gFace()->group()->size(100);

Focus on the left side

use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->size(300)->group()->gLeft()->width(120);

Focus on the bottom right side

use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->width(300)->group()->gBottomRight()->size(100);

Focus on the given X,Y points

use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->width(500)->group()->crop()->gXYCenter()->x(140)->y(230)->width(120)->height(60);

Focus on face and the top right side

use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->width(200)->group()->gFace()->gTopRight()->size(100);

Find the face and focus on it; the height and weight is set to 100 px

use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->gFace(3)->group()->size(100);
Table of contents