|
Last updated: 06/30/2009
You can dynamically generate images in php
using the GD library, and functions like imagecreatefrompng.
When trying to add text, you do something like:
imagecolorallocate($im, 0xFF,0xFF,0xFF);
The problem manifests itself in that the text you put on the image, rather than showing up white (or the color you chose), shows up gray, or some other color.
The fix:
I've found that you need to reduce the # of colors used by the image, to less than 255. In GIMP, I do the following:
1. Load up the image 2. Choose Image -> Mode -> Indexed 3. If "Indexed" is grayed out, choose RGB first, then go back in and Indexed will be available. 4. Bump the Maximum # of colors down to 250 or so. 5. Set Dithering to None (not sure if this is necessary, but it works) 6. Click Ok, and save the image (I save as PNG).
This worked for me. Good luck!
|