I am creating an image with a caption using the Imagick::newPseudoImage function as follows:
$txt = new Imagick();
$txt->setFont("templates/fonts/Gloria.ttf");
$txt->setGravity(imagick::GRAVITY_CENTER);
$txt->newPseudoImage( $image_width, $image_height, "caption:" . $text );
This draws a black caption. I want to customize the color of this caption. I know there are other methods of drawing text with Imagick. I need to use the newPseudoImage with caption instead of these other methods because it automatically wraps and sizes the text to fit in a given rectangle.
You can use colorizeImage. I hope this can help you: