Type to search...



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.


  • bg


  • CSS/HTML employs the usual # + hexadecimal values, but without the starting character of # : RGB, RGBA, RRGGBB, RRGGBBAA formats are available
  • Specified colors


  • This transformation does not have any limitations.


  • This transformation does not have any dependencies.


See the following examples about the possible ways of usage.

Rotate image and change the background color

use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->size(200)->rotateCW(45)->background('f538');
Table of contents