Here's a example of this function:
<?php
$img = new Imagick();
$img->readImage($image_file_name);
// leave hue at 100%, drop saturation by 100%, leave brightness at 100%
$img->modulateImage(100, 0, 100);
$img->writeImage($thumb_file_name);
$img->clear();
$img->destroy();
?>