Portable Network Graphics (PNG) is a bitmapped image format that employs lossless data compression. PNG was created to improve upon and replace GIF (Graphics Interchange Format) as an image-file format not requiring a patent license. It is pronounced /ˈpɪŋ/ or spelled out as P-N-G. The PNG initialism is optionally recursive, unofficially standing for “PNG’s Not GIF”.
PNG supports palette-based (palettes of 24-bit RGB colors), greyscale or RGB images. PNG was designed for transferring images on the Internet, not professional graphics, and so does not support other color spaces (such as CMYK).
In computing, JPEG (pronounced JAY-peg; IPA: /ˈdʒeɪpɛɡ/) is a commonly used method of compression for photographic images. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality. JPEG typically achieves 10 to 1 compression with little perceivable loss in image quality.
JPEG is the most common image format used by digital cameras and other photographic image capture devices, and is the most common format for storing and transmitting photographic images on the World Wide Web.
There are only three graphic file formats that are used on the web: JPEG, GIF and PNG.
The most important thing to understand is when to use each type. JPEG, GIF and PNG use very different forms of encoding and compression of the data that give them quite different uses.
GIF and PNG files work best on text, text-art, cartoons, drawings, ilustrations, any art which needs transparent backgrounds.
GIF is limited in the total number of colors to 256 or less. PNG is more advanced and can handle true color images, but doing so significantly increases file size.
JPEG on the other hand works best on photographs. JPEG does not handle sharp edges and can produce artifacts due to his lossy compression.
But let’s learn more about each format.
The Graphics Interchange Format (GIF) is an 8-bit-per-pixel bitmap image format that was introduced by CompuServe in 1987 and has since come into widespread usage on the World Wide Web due to its wide support and portability.
The format uses a palette of up to 256 distinct colors from the 24-bit RGB color space. It also supports animations and allows a separate palette of 256 colors for each frame. The color limitation makes the GIF format unsuitable for reproducing color photographs and other images with continuous color, but it is well-suited for more simple images such as graphics or logos with solid areas of color.