Type to search...

Round

round

Serves to round corners.

Aliases

  • ro

Parameters

  • 1 or larger integer [px], 4 parameters:
    1. radius of rounding for the upper left corner
    2. radius of rounding for the upper right corner
    3. radius of rounding for the lower right corner
    4. radius of rounding for the lower left
  • rounding for maximum
    • max: rounds all four corners of the image to the maximum available amount

Limitations

  • the radius of the rounding cannot be larger than half of the length of the side, both directions
    • normally, the radius could be as big as the smaller side of the image

Dependencies

  • the background parameter will provide the background color of the rounded corners

Examples

See the following examples about the possible ways of usage.

Find and crop face with 30 px border radius

g:face/w:100_round:30
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->gFace()->group()->width(100)->round(30);

Find and crop face with maximum border radius

g:face/w:100_round:max
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->gFace()->group()->width(100)->roundMax();

Find and crop face with maximum border radius with red color

g:face/w:100_round:max_bg:red
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->gFace()->group()->width(100)->roundMax()->background('red');

Find and crop face, two corners get 50 px border radius with white color

g:face/w:100_round:0,50,0,50_bg:white
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->gFace()->group()->width(100)->round(0, 50, 0, 50)->background('white');
Table of contents