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.
The sample code is below. $fg and $lg used in ImagickDraw are unexcepted in image.
php 5.6.21
Imagick compiled with ImageMagick version => ImageMagick 6.7.8-9 2016-03-31 Q16 http://www.imagemagick.org
I do not believe the Imagemagick -draw works with CMYK images. I think it needs to draw on an RGB image, since it converts CMYK color values into RGB before drawing. However, I will defer to one of the IM developers to correct me if I am wrong.