[thelist] Convert Text to Image in PHP

Fred Jones fredthejonester at gmail.com
Mon Dec 15 13:36:44 CST 2008


> ImageMagick should be able to do this via convert. I played with creating text a while go just to see, but didn't have a live need.
>
> http://www.imagemagick.org/Usage/text/
>
> convert -background floralwhite -fill "#568100" -size 200x label:"Fred Jones" fred_jones.png
>
> convert -background floralwhite -fill "#568100" -size x100 label:"Fred Jones" fred_jones2.png

This is great. Works wonderfully from the command line. I found append
also and am getting what I need.

> in PHP:
>
> you can use system
>
> system ("convert ...");

This didn't work out of the box, but I can fix that probably.

Only issue thus far is that quality of the image isn't that great. I'm
not sure if it's the rendering or the fonts or both. I am going to
play with GD also and see if I can get better.

Thank you very much for that 'copy and paste' code--really sent me in
the right direction.

Thanks,
Fred



More information about the thelist mailing list