I have this servlet which generates an image dynamically and sends it to the client. This image can be sent as a PNG or JPEG; which is more convenient if quality of the image is not a major concern? - Manish
Which is purely size. In this case you are really looking at apples and oranges. My understanding is that PNG is close to GIF in that it gets better performance with images that have a limitted number of colors, like cartoon type graphics. JPEGs are better for photo style images with large numbers of colors and color gradients. Viewed that way, if you are creating images in a servlet is might be the case that they are closer to the cartoon style and would therefore be better as PNGs. You may find that a JPG of a comparable size has significant dithering and is less useful.