Simply set label colour to white

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
hivens
Posts: 8
Joined: 2017-02-24T03:49:36-07:00
Authentication code: 1151

Simply set label colour to white

Post by hivens » 2017-03-04T01:11:06-07:00

Hi,

This sounds like an easy thing but stakeoverflow has failed me, so I'm hoping you will be able to help. I've got a transparent pseudo image which has a label field like this:

Code: Select all

$image->newPseudoImage(400, 300, "label:$inputdata");
This is then merged onto another pseduo layer with a gradient and then shown.

I can't work out how I am meant to set the label colour to white. I know it was fairly simple when using annotate image, but I don't know about how to do it with label. Any help would be appreciated.

snibgo
Posts: 9403
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Simply set label colour to white

Post by snibgo » 2017-03-04T11:08:57-07:00

The question is often asked, and I think the answer is: in IMagick, you can't set the fill colour for "label:".
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 22105
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Simply set label colour to white

Post by fmw42 » 2017-03-04T11:12:03-07:00

try

Code: Select all

$image->newPseudoImage(400, 300, "canvas:white");
or

Code: Select all

$image->newPseudoImage(400, 300, "xc:white");
See http://us3.php.net/manual/en/imagick.newpseudoimage.php and http://www.imagemagick.org/script/formats.php#pseudo

Post Reply