Background
background
You can provide the filling color of the area behind the picture. Can be used in the following cases, e.g.:
- The outcome of the transformation contains transparent images, but you don’t want it to be there or want to make changes to it
- If the output format does not support transparency, e.g.: JPG. Such images - that do not support transparency- will get a basic black background by default, but you can change it to another color, e.g.: if the website is white, the background of the image should be white as well.
Aliases
bg
Parameters
- CSS/HTML employs the usual
#
+ hexadecimal values, but without the starting character of#
:RGB
,RGBA
,RRGGBB
,RRGGBBAA
formats are available - Specified colors
Limitations
- This transformation does not have any limitations.
Dependencies
- This transformation does not have any dependencies.
Examples
See the following examples about the possible ways of usage.
Rotate image and change the background color
wh:200_r:45_bg:f538
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->size(200)->rotateCW(45)->background('f538');