optimize()
optimize(string $path, integer $svgo, integer $image_optim, integer $picopt, integer $imageOptim)
Optimizes the image without reducing quality.
This function calls up to four external programs, which must be installed and available in the $PATH:
- SVGO
- image_optim
- picopt
- ImageOptim
Note that these are executed using PHP’s exec command, so there may be security implications.
Parameters
| string | $path | The path to the file or directory that should be optimized. |
| integer | $svgo | The number of times to optimize using SVGO. |
| integer | $image_optim | The number of times to optimize using image_optim. |
| integer | $picopt | The number of times to optimize using picopt. |
| integer | $imageOptim | The number of times to optimize using ImageOptim. |