Who needs ImageMagick? Take a look at the built-in image functions using gd.
EDIT Basic example:
<?php
$filename = "myfolder/test.jpg";
$jpg = @imagecreatefromjpeg($filename);
if ($jpg)
{
header("Content-type: image/png");
imagepng($jpg);
imagedestroy($jpg);
exit;
}
// JPEG couldn't be loaded, maybe show a default image
?>
You can do more with this such as change compression and quality values etc, save the output to a file instead of outputting to the browser and so on - check the docs for further info :-)
Note that the image functions issue warnings/notices etc if there are problems loading an image, hence the use of the @ symbol to suppress, otherwise you'll get spurious output instead of just the image data.