PNG Image Creation

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
Forum Newbie
Posts: 1
Joined: Fri Feb 19, 2010 6:37 am

PNG Image Creation

Post by jlauffer »

Good morning all,

I have been assigned a job to create a PHP Script that will take a Television News Graphic and add 2 Lines of Text to it. (The things that show the persons name on the bottom of the screen)

I was wondering what kind of GD Script I would need to make a transparent image from text that is supplied in a form, to combine on the graphic and make the finished product.

Please help, this is due very soon and I am clueless. My AIM is Justin34238SRQ if you'd like to IM me there.
User avatar
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: PNG Image Creation

Post by greyhoundcode »

It should be fairly simple, the functions you are likely to need include ImageCreateFromPNG(), ImageString() and ImagePNG().

As a minimum all you need to do is load your "news graphic", add the relevant string of text and then spit it back out as a PNG (or JPEG or whatever).

Of course, for more polished results, you might want to split up the text according to image width etc.

How far have you got so far?
Post Reply