How can image conversion tools like ImageMagick be integrated into PHP scripts for more flexibility in image format options?

ImageMagick can be integrated into PHP scripts by using the `exec()` function to call ImageMagick commands from the command line. This allows for more flexibility in converting images to different formats and performing various image manipulation tasks. By using ImageMagick in PHP scripts, developers can take advantage of its powerful features and capabilities for handling images.

// Example code snippet for using ImageMagick in PHP script

$imagePath = 'input.jpg';
$outputPath = 'output.png';

$command = "convert $imagePath $outputPath";
exec($command);