The PNG Image Format

I have written posts about the JPEG and TIFF file format, including the advantages and disadvantages of each. Digital cameras use the JPEG format because of it’s small size, so you can store more photos on a memory card. The downside to the JPEG is that is is lossy compression, so you lose some data with each save.

An alternative to the JPEG file format is the TIFF format. While you won’t lose any informatoin with the TIFF format, you will require a lot of disk storage as each file can be quite large. For those looking for another alternative, you can try using the PNG format, which is a nice compromise between the two previous image types.

What is the PNG Format?

PNG is an acronym for Portable Network Graphics. The PNG format began in 1995 after it was discovered that the compression algorithm used by the GIF format was patented. In an effort to avoid any problems with the patent, the PNG format was created in 1996.

While the GIF format supports only 256 colours, the PNG format supports 256 and many more, including 48-bit colour. This makes the PNG an alternative to both the JPEG and TIFF image formats as well as for GIF files.

JPEG Versus PNG

One of the biggest differences between the two formats is the type of compression. JPEG uses a lossy compression, meaning some data is lost each time an image is compressed (saved). The PNG format, on the other hand, uses a lossless compression, which means it doesn’t lose any data. You can save a PNG image many times, and you won’t notice degradation in the quality.

If you take photographic images, and would like to save the image in the smallest possible size (in terms of bytes), then the JPEG format will produce a smaller file size than the PNG format.

The type of images a the PNG format can handle better than the JPEG format is with images that contain sharp transitions, line art, or text. The figure on the left shows the difference between a JPEG and PNG image that contains text. You can clearly see the JPEG artifacts in the JPEG image, while the PNG image stays nice and sharp.

For most photographic images, you may want to stay with the JPEG format, however, if you notice artifacts that do take away from the image, or your image contains sharp transitions, you may want to use the PNG format.

TIFF Versus PNG

I use the TIFF format for archiving, and I will continue to do so as it is very widely accepted across many operating systems and applications. The problem with TIFF files is the very large file size.

You can compress TIFF files using the LZW compression (the same compression that was once patented and used by the GIF file format), however, the images will still be fairly large. If you would like TIFF-quality images, but not the file size, then you can use the PNG format. The compression with PNG is much better, and you will end up with much smaller files.

Some TIFF files are capable of using the same compression as the PNG format, however, it isn’t widely used or accepted by applications.

PNG Support

Among the file types discussed in this post, the PNG file type is by far the newest, and because of this some applications may not be able to handle a PNG file. The biggest concern are the web browsers.

All current versions of the web browsers, including Internet Explorer, Firefox, Opera, and Safari, fully support the PNG file format. Internet Explorer versions prior to 7.0 may have issues with the PNG format. If you have version 6.0, then there may be problems with transparent PNG files, but other than that you shouldn’t notice any issues. If your are still running a version prior to IE 6.0, which you shouldn’t be, then your browser may not fully support the PNG format. Older browsers may also not fully support the PNG format.

Since most people seem to be running the newer versions of the browsers, there really isn’t a problem using the PNG format on your web site.

Summary

While the GIF, JPEG, and TIFF format are widely used, each one has it’s own limitations. The GIF has a 256 colour limitation, the JPEG uses lossy compression, and TIFF files are very large. As a compromise, the new PNG format can be used in certain circumstances in place of all three formats. Like each format, however, the PNG format has it’s place and will not completely replace the other three formats.

Related Links

Overview of Various Image File Formats
When to Use GIF and JPEG Format

PG

About Paul Salmon

Paul Salmon is the founder of Technically Easy. He is a an experienced PC user, and enjoys solving computer-related problems that he encounters on a regular basis.

Facebook | Twitter | Google+

Photos

7 Comments

  1. Pembrokeshire
    Posted October 15, 2008 at 9:10 am | Permalink

    We use png format for the headers and a couple of the pictures in our Directory you have a nice sharp image.

  2. HTML Users
    Posted October 15, 2008 at 5:02 am | Permalink

    I’ve also have issues using PNG’s with transparency in IE7, although the same graphic worked fine in FF2 and 3.

  3. Posted October 12, 2008 at 3:43 am | Permalink

    There are also two main types of png’s. png-8 and png-24. png-8 is usually as small as a gif. png-24 larger than a jpg.

  4. Posted October 11, 2008 at 11:29 pm | Permalink

    @Lux: I save my archival digital photos and scans as TIFF, since it is more widely accepted.

    @Tom: I haven’t really converted files in batch. I usually only batch process files when I save my digital photos for printing. With that I use actions in Photoshop.

  5. Posted October 11, 2008 at 9:34 pm | Permalink

    How do you convert the files? Do you do a batch save with the .tff extension?

  6. Posted October 11, 2008 at 12:42 am | Permalink

    We save files as either .tiff or .psd on the computer, but usually post .pngs on my blog – interesting post.

  7. Michael
    Posted October 10, 2008 at 7:38 pm | Permalink

    The reason why I use PNG is mainly for Photoshop. Its great if your image has a transparent background although most other times I just use JPG.

    Thanks for the interesting article. Keep up the good work.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting

  • About Me

    I am Paul Salmon, an avid technology fanatic who is always learning new things. My goal is to inform and help others with technology.

    With this blog I try to cover various topics on this blog to cover a broad range of topics.

    Read more...

  • Recommended Tool

    Namecheap.com - Cheap domain name registration, renewal and transfers - from only $3.98/Year

    Namecheap is a great, and popular, place to buy a domain name. They have some of the cheapest rates for domains anywhere. I currently have a few domains with Namecheap.

    If you buy a domain through Namecheap using the above image, I will provide free help with connecting your domain with your website.

  • Recent Posts