PNG: Portable Network Graphics

 PNG (Portable Network Graphics) is a file format used for lossless image compression. PNG has almost entirely replaced the Graphics Interchange Format (GIF) that was widely used in the past.

Like a GIF, a PNG file is compressed in lossless fashion, meaning all image information is restored when the file is decompressed during viewing. A PNG file is not intended to replace the JPEG format, which is "lossy" but lets the creator make a trade-off between file size and image quality when the image is compressed. Typically, an image in a PNG file can be 10 percent to 30 percent more compressed than in a GIF format.

File format of PNG

The PNG format includes these features:

  • Not only can one color be made transparent, but the degree of transparency, called opacity, can be controlled.
  • Supports image interlacing and develops faster than in interlaced GIF format.
  • Gamma correction allows tuning of the image’s color brightness required by specific display manufacturers.
  • Images can be saved using true color, as well as in the palette and grayscale formats provided by the GIF.

JPEG vs. PNG

JPEG and PNG are the two most commonly used image file formats on the web, but there are differences between them.

JPEG (Joint Photographic Experts Group) was created in 1986. This image format takes up very little storage space and is quick to upload or download. JPEGs can display millions of colors, so they’re perfect for real-life images, such as photographs. They work well on websites and are ideal for posting on social media.

Because JPEG is “lossy,” -- which means that when data is compressed, unnecessary (redundant) information is deleted from the file permanently -- some quality will be lost or compromised when a file is converted to a JPEG.

JPEG is the default file format for uploading pictures to the web, unless they have text in them, need transparency, are animated or would benefit from color changes, such as logos or icons.

However, JPEGs aren’t good for images that have very few color data, such as interface screenshots and other simple computer-generated graphics.

The main advantage of PNG over JPEG is that the compression is lossless, which means there’s no loss in quality each time a file is opened and saved again. PNG is also good for detailed, high-contrast images. Consequently, PNG is typically the default file format for screenshots because, instead of compressing groups of pixels together, it offers a nearly perfect pixel-for-pixel representation of the screen.

Another key feature of PNG is that it supports transparency. With both grayscale and color and images, pixels in PNG files can be transparent, enabling users to create images that overlay neatly with the content of a website or image.

Uses of PNG

PNG can be used for:

  • Photos with line art, such as drawings, illustrations and comics.
  • Photos or scans of text, such as handwritten letters or newspaper articles.
  • Charts, logos, graphs, architectural plans and blueprints.
  • Anything with text, such as page layouts made in Photoshop or InDesign then saved as images.

Advantages of PNG

The advantages of the PNG format include:

  • Lossless compression -- doesn’t lose detail and quality after image compression.
  • Supports a large number of colors -- the format is suitable for different types of digital images, including photographs and graphics.
  • Support for transparency -- supports compression of digital images with transparent areas.
  • Perfect for editing images – lossless compressions makes it perfect for storing digital images for editing.
  • Sharp edges and solid colors -- ideal for images containing texts, line arts and graphics.

The disadvantages of the PNG format include:

  • Bigger file size -- compresses digital images at a larger file size.
  • Not ideal for professional-quality print graphics -- doesn’t support non-RGB color spaces such as CMYK (cyan, magenta, yellow and black).
  • Doesn’t support embedding EXIF metadata used by most digital cameras.
  • Doesn’t natively support animation, but there are unofficial extensions available.

Comments