How to Make glitter graphix using php.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
manjifera
Forum Newbie
Posts: 8
Joined: Sun May 11, 2008 2:52 am

How to Make glitter graphix using php.

Post by manjifera »

Hi all can any one give me any idea How i can make gif animated text glitter graphix using php and classes?

I have created this using php

http://www.orkutscrap.byethost5.com/lovepain/love.htm
Image
but not able to create like this

Image

Thanks in advance...
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: How to Make glitter graphix using php.

Post by onion2k »

Actually making the individual frames shouldn't be too hard, you'd just need to work out a nice way of making the text. imagettf() will do any TTF font but only in plain text.. you might be better off copying individual bitmap letters from separate files into a single image. I'll leave you to figure that out (because it's easy).

The glitter effect can be acheived with imagesetpixel() ... just generate random coordinates on the canvas and set that pixel (plus the surrounding ones) to the glitter colour.

Animating it is the hard bit. Fortunately there's a gif encoder class here: http://phpclasses.gifs.hu/show.php?src= ... .class.php .. unfortunately there's no documentation for it though, but it is used in GIFbuilder that you can download from http://phpclasses.gifs.hu/show.php?page=0 and examine. It's not that complicated...

You should note that using a photo background in a gif will make a MASSIVE file and it'll look pretty horrible because it'll only be 256 colours (GIFs can have more, but it's very complicated, and well beyond the scope of this thread).
Post Reply