Type to search...

Border

border

Provides a frame for the image based on the color parameter. The framing is outward, so a border of 4px will result in an image 8px larger than the original in both directions.

Aliases

  • bo

Parameters

The values are integers equal to or larger than 0, and should be interpreted as pixel numbers

  • 1 parameter mode: the width of the frame (top-left-bottom-right)
  • 2 parameters mode (top-bottom,left-right)
      1. parameter: width of the frame up and down
      1. parameter: width of the frame right and left
  • 3 parameters mode (top,left-right,bottom)
      1. parameter: width of upper frame
      1. parameter: width of frame on the right and left
      1. parameter: width of lower frame
  • 4 parameters mode (top,right,bottom,left)
      1. parameter: width of upper frame
      1. parameter: width of frame on the right
      1. parameter: width of lower frame
      1. parameter: width of frame on the left

The parameters should be interpreted similar to the CSS padding’s parameters.

Limitations

  • This transformation does not have any limitations.

Dependencies

  • color

Examples

See the following examples about the possible ways of usage.

Adds green border to the image

w:100_bo:10_co:green
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->width(100)->border(10)->color('green');

Adds black border to the image

w:100_bo:10,0,10_co:black
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->width(100)->border(10,0,10)->color('black');
Table of contents