GD, write text on image

From: Date: Wed, 23 Apr 2003 14:36:00 +0000
Subject: GD, write text on image
Groups: php.windows 
Request: Send a blank email to php-windows+get-19574@lists.php.net to get a copy of this message
Hi, I'm going to write some text on an image. My problem is, if the background is to bright I cannot read the text if it's white. If I use black as the text-color I cannot read it, if the background is to dark. Hence I'm looking for a way to either determine the darkest corner of the picture to write white text into (dimensions of the "corner" are counted by imagettfbbox), or a way to determine the brightness of the defined corner and dependend on the darkness use black or white text. I wonder if someone has ever done this. I could of course take the box to write the text into, add each pixel's color and divide by the number of the pixels or something like that, but I'm sure it's not a fast way. Have you ever argued about text you wrote on an image and could not read because of the background? Thanks, Bernhard

« previous php.windows (#19574) next »