For starters you are going to need gd installedon your system and php configured to use gd. The GD section of the php manual is actually very helpful.
One word of warning, gd hasn't supported gif files for a few releases (png is better anyway) due to licence issues, so you'll need to use something like Image Magick or gif2png to do the conversion.
Basically your script should follow a structure similar to this:
Get image
Check image type
convert image
save image
I could give you more detail but you wanted 'a starting point'; and if I gave you a script that does this you wouldn't learn nothing. :-)
If you need more help, drop me an email I'll be happy to give you some more assistance.
-- Nick.