Format
format
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.
Formats
jpg
,jpeg
bmp
gif
png
,png8
,png24
,png32
,png48
,png64
eps
webp
,webp-lossless
svg
tiff
jp2
Limitations
- 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)
Dependencies
- This transformation does not have any dependencies.
Example
See the following examples about the possible ways of usage.
Set the width to 200, and the output format will be gif
w:200/format:gif
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->width(200)->toGif();
Set the width to 200 and the output format to lossless webp
w:200_format:webp-lossless/i/steve
use shardimage\shardimagephp\factories\Transformation;
$transformations = (new Transformation())->width(200)->toWebp();