This is how to Monochrome a jpg [on Windows].. since I couldn't find it anywhere else.
<?php
header("Content-type: image/jpeg");
$IMagick = new IMagick('c:\\testing\\fruit.jpg');
$IMagick->setImageColorSpace(Imagick::COLORSPACE_GRAY);
echo $IMagick;
?>
Imagick::setImageColorspace
(PECL imagick 2.0.0)
Imagick::setImageColorspace — Sets the image colorspace
Descrição
bool Imagick::setImageColorspace
( int $colorspace
)
Sets the image colorspace.
Parâmetros
- colorspace
-
Valor Retornado
Retorna TRUE em sucesso.
Erros
Dispara ImagickException em erro.
User Contributed Notes
Imagick::setImageColorspace
Imagick::setImageColorspace
mettedraq at gmail dot com
01-Jul-2010 04:21
01-Jul-2010 04:21
charlie at midsouthhost dot com
07-May-2010 01:45
07-May-2010 01:45
If your getting strange/bad color rendering from a PDF, after trying the colorspace constants noted by jdstraughan, try other values outside that range.
In one case for me only $image->setImageColorSpace(22) provided useful color. I have found posts elsewhere using values up to 255.
jdstraughan dot com at gmail dot com
26-Sep-2008 04:16
26-Sep-2008 04:16
FYI, here is the breakdown for (int $colorspace):
Constants:
0 - UndefinedColorspace
1 - RGBColorspace
2 - GRAYColorspace
3 - TransparentColorspace
4 - OHTAColorspace
5 - LABColorspace
6 - XYZColorspace
7 - YCbCrColorspace
8 - YCCColorspace
9 - YIQColorspace
10 - YPbPrColorspace
11 - YUVColorspace
12 - CMYKColorspace
13 - sRGBColorspace
14 - HSBColorspace
15 - HSLColorspace
16 - HWBColorspace

Imagick::setImageColormapColor