Does anyone know of any pitfalls for using PNG's on web pages? Also, how do they differ from the ever-popular GIF format? I know that both support transparency, and I know that both load faster than JPG. Also, I have been informed that PNG is recognized by all browsers, though the format isn't used as widely as GIF and JPG.
PNG is a great format. You can have alpha transparency (so proper shadows and the like, blending into whatever colour the background is (although IE doesn't support it )), gamma support (so it looks the right colour on other platforms like Mac), better interlacing (you see a "preview" of the image faster, and it updates more often), true colour and lossless. Probably some more that I can't remember right now. Browser support is pretty good too. NS 4.x supports it (although has some bugs with transparency). I use pretty much only PNG.
You should not characterize this as a general rule. JPEG will better compress images with many changing colors (real life pictures, gradients, etc.). GIF and PNG are better at compressing images made of areas of solid colors. PNG is, however, most certainly a better format than GIF.
Thanks, guys. Most helpful, indeed. I don't know that I will be dealing much with transparency if I don't have to, especially with .png. If I need transparency, I will most likely rely on .gif images to help me with that because I know I can trust it with the browsers.
However, I do believe I will try using .png for some backgrounds and other images that contain a large area of one color.
I thought that never happened, and it was just talk? Hopefully more browsers will support MNG too, so we can have animated PNGs. Currently I think Mozilla is the only browser that supports it natively.