Type to search...



Specifying the output format. If it is not specified, then the output is - if available - the original format. The last value is the decisive one; the previous format specifications will be discarded.

It can be placed at the end of the public ID with . + format, but it only works if there is a public ID with it at the same time.


  • jpg, jpeg
  • bmp
  • gif
  • png, png8, png24, png32, png48, png64
  • eps
  • webp, webp-lossless
  • svg
  • tiff
  • jp2


  • if you want to display your image in a web browser, please consider that certain formats are not supported by some browsers (e.g.: webp)


  • This transformation does not have any dependencies.


See the following examples about the possible ways of usage.

Set the width to 200, and the output format will be gif

use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->width(200)->toGif();

Set the width to 200 and the output format to lossless webp

use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->width(200)->toWebp();
Table of contents