Trim an image, then display to the browser.
<?php
/* Create the object and read the image in */
$im = new Imagick("image.jpg");
/* Trim the image. */
$im->trimImage(0);
/* Ouput the image */
header("Content-Type: image/" . $im->getImageFormat());
echo $im;
?>