The PNG format is generally best for web images. It is lossless, so you don't have to worry about your image's quality and it can also keep your image's transparency (as long as your user don't have Internet Explorer). The GIF format is also a reasonable choice, and it is the only format that you can use for animations. GIFs are limited in their 1 bit transparency and limited color palette, though. If you are designing a very large image or file size is very important to you, you can use the JPEG format-but remember that it doesn't hold transparency information and it is a lossy format so your image won't look quite as good. If you are designing a favicon, you should save it as an ICO image.
You can also export your image as Source Code to generate code that will dynamically redraw your image's contents. JavaScript Canvas code can be incorporated with the canvas HTML element to add dynamic graphics.