PNG (Portable Network Graphics) is a graphics file format for bitmaps based on a non-patent lossless compression algorithm.
What is a PNG File Format?
The PNG file was developed largely to overcome the shortcomings of the GIF format and allows storing images with deeper contrast and other important data and uses an image file .png extension.
PNG was created in 1995 after Unisys announced it would enforce a software patent for the LZW data compression algorithm used by GIF.
There were other issues with the GIF format, for example, when computers already supported thousands or millions of colors, they had to limit this to 8-bit palettes of a maximum of 256 colors.
Originally, PNG was called a recursive acronym meaning not GIF.
Although GIF supports animation, this file type was developed as a static image format and created as an animated variant of the MNG format.
PNG became a more used file type in August 1999 when Unisys ended its royalty-free patent licenses policy for free or non-commercial software developers.
The PNG Version 1.0 specification was released on July 1, 1996, and later came out as RFC 2083. It was recommended by the W3C in a very short time on 1 October 1996.
On December 31, 1998 version 1.1 released with 3 new extensions or chunks with some minor changes. Version 1.2 was released on August 11, 1999. Because PNG is an international standard, it was recommended to everyone by the W3C on 10 November 2003.
File Segments Feature
There are a number of sections that store specific information about each image. Segments declare themselves critical or helpful so that a program that encounters an auxiliary segment and does not understand it can safely ignore it.
The segment-based structure is designed to extend the PNG format while maintaining compatibility with older versions.
Each partition has a header indicating its size and type, as well as a checksum of the data. Sections have a case sensitive 4 letter name.
Using upper or lower case letters in this name provides information to decoders about unrecognized parts. If the first letter is capital, it indicates that this part is required, otherwise it will help.
Sections are required to read the file, if the decoder finds an important part that it does not recognize, it should cancel it.
If the second letter is capitalized, this means that the section is public or private in the specification or registration of the special purpose sections.
This use of upper and lower case letters ensures that there is never any conflict between the general and private sections. The third letter must be capitalized to accommodate PNG specifications, and this is reserved for future expansion.
The fourth letter indicates whether the section is safe to copy if it is not recognized.
If it is lowercase, it is safe to copy the partition regardless of the number of changes the file has gone through, while the upper case can only be copied if there are no critical sections that have undergone changes.
Understanding the Metadata Sections
Other attributes that can be saved in a PNG image are gamma values, background color, and text information. It also uses color correction used by color management systems such as sRGB, and some of Adobe‘s programs such as Photoshop also have this system.
It contains the default background color, which is used when there is not the best color that can be displayed, as in the image viewer, but not in a web browser.
It creates a white balance.
It indicates the gamma value.
It saves the histogram or total amount of each color in the image.
It contains the ICC color profile.
It contains a compressed or uncompressed text (UTF-8).
It includes the expected pixel size and aspect ratio.
It shows the accuracy of the colors in the image.
It suggests a palette to use if the full range of colors is not available.
It indicates that the sRBG color space standard is used.
It stores text that can be represented by a name = value for each section in ISO 8859-1.
It saves the date of the last change.
It contains information about transparency and stores the alpha channel for one or more palettes for indexed images and the information of a single-pixel that should be considered completely transparent for true color and grayscale images.
It contains compressed text with the same boundaries as tEXt.
The first lowercase letter in these sections indicates that these are not required in the PNG specification, and the last lowercase letter indicates that it is safe to copy even if the application in question does not understand them.
Color Depth Feature
Images in PNG format can be indexed palette images and consist of more channels. If there are multiple channels, all channels have the same number of bits per pixel.
Official PNG specification bit depth per channel, normally editing programs only name the total number of bits per pixel (color depth).
The number of channels depends on whether the image is grayscale or color and has an alpha channel.
Indexed images are limited to a maximum of 256 colors. This color palette is stored with an 8-bit channel depth. The palette cannot have more colors than those marked with bit depth, i.e. 28 = 256 colors.
Image Transparency Rate
PNG offers a wide variety of transparency options, and even a single pixel can be transparent with true color or grayscale, or an alpha channel can be added.
For images using palettes, an alpha channel can be added to the palette entries. The number of such stored values may be less than the total number of entries in the palette, and the rest of the entries will be considered completely opaque.
Searching for pixels with double transparency can be done before any color reduction to prevent some pixels from accidentally becoming transparent.
The compression method used in this format is also known as deflation.
In filtering methods, specification 1.2 defines a single filter type that includes 5-pixel value prediction modes that are very useful for improving compression, in which a filtering method is chosen that estimates the color of the image for each row of the image.
Thus, each pixel is based on the previous pixel colors and subtracts the predicted color from the current pixel color. These five methods are None, Sub, Up, Average, and Paeth.
These filters can drastically reduce the final file size to the input image. The compression algorithm may be interested in choosing the appropriate method that offers the greatest reduction.
The MIME media type is image/png and was approved on October 14, 1996.
Animation/Moving Image Feature
APNG is a PNG-based format that supports animation and supports the display of a single image if the decoder does not understand this format. It is accepted by browsers such as Firefox and Chrome and the file extension is .png.
MNG is an image format that supports animation, based on ideas and parts of PNG. However, it is a complex system and does not allow a single image to be displayed if GIF and APNG do.
Comparison with Other Formats
Comparing GIF to PNG
In most cases, it provides better compression than GIF, but some applications make a poor selection of filtering methods resulting in larger file sizes.
It supports 1-bit or binary transparency indexed images, such as GIF. This type of transparency does not require additional channels and allows only one color in the palette to appear 100% transparent.
This format offers millions of color depth formats and an alpha channel feature with transparency values in between, providing much richer and more accurate color ranges than GIF.
While GIF supports animation, this format does not.
Comparing JPEG to PNG
PNG and JPEG are image formats designed for different purposes, so only a general comparison can be made.
JPEG has a large compression rate to the detriment of image quality and is an ideal file format for large images and photos, but does not accept transparency.
It is a lossless format with excellent compression and is ideal for images with large areas of solid color or with little color variation.
Additionally, it support alpha channels and some extra features like gamma correction.
The LZW compression algorithm, which uses the popular GIF graphics format, belongs to Unisys company.
Although the GIF format is patented, this does not prevent it from being the most widely used graphic format on the Internet for use on web pages.
Although it is unlikely that this will affect individual designers or even professionals and administrators of corporate websites, this format has proven to be used more in the Webspace.
This format was officially published by the World Wide Web Consortium in October 1996.
This is a free-to-use file type that does not require any license for applications that use, create or edit images, like other image formats from this international consortium.
The PNG format allows you to create bitmap images with a high size compression ratio. It does not create any loss of quality like the GIF format but has higher average compression.
Although it looks like GIF, it supports transparent backgrounds allowing the image to integrate well with the actual background of the web page.
PNG is superior to GIF in supporting color depth of up to 16.7 million colors. GIF only supports a maximum of 256 different colors in the same image. PNG also has two compression modes, standard and progressive.
♦ TIFF Format
♦ What is CMYK?
♦ RGB Colors
♦ What is the Algorithm?