how to set "colors 16" property

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
ivobrabec

how to set "colors 16" property

Post by ivobrabec »

I am trying to convert image to less size, in the past I was using

exec("convert ".$in." -colorspace gray -depth 8 -colors 16 ".$out);

since i have no longer access to exec, i am trying to use the php commands but have found no option how to make the -colors 16 property.

I am using this script:
$image=new Imagick();
$image->readImage($in);
$image->setImageColorspace(Imagick::COLORSPACE_GRAY);
$image->setImageDepth(8);
$image->setImageFileName($out);
$image->writeImage();

Can somebody give me a hint on the command to be used to define the colors?
Thanks
IvO
Post Reply