Everybody knows that there are plenty of image formats available today. However when it comes to PNG vs JPG battle, not everyone exactly understand the difference. In digital image creation, we must consider file formats. A file is a document – like a photo, a graphic, or a spreadsheet, for example. Files created on different software, have different formats. For example, an XLS file is a Microsoft Excel spreadsheet, a DOC file is a Microsoft Word document and so on.
There is a host of different image file formats too. If you extensively use digital images or intend to use images for web content etc., it is important to understand the best file formats to use – noticeably JPG and PNG format. In this article we look at both image formats, what they are used for, and how they compare.
PNG vs JPG – The most popular image formats
So why these two specific file types? There are of course other image file formats – TIFF, BMP, GIF, PSD, and RAW, for example. Why not use one of these instead?
In most instances, JPG or PNG offer the best compression rates and retention of image quality. Furthermore, file types like RAW, and PSD have specialist purposes. We have given a brief description of these other image types below:
- RAW: Un-processed file format used in photography
- TIFF: Large faster file with lossless compression
- PSD: Native file format for Adobe Photoshop
- BMP: Raster graphics file with lower quality
- GIF: Often used for short frame-by-frame animations
As you will see below, .JPG and .PNG are better suited than the above file formats for general usage – such as web content, and in standard documents. In the sections below, we describe in detail each image format, and conclude with a comparison between the two:
JPG file format / JPEG
- Stands for: Joint Photographic Experts Group
- Compression Type: DCT (Discrete Cosine Transform)
- Quality Loss: Lossy
- File Size: Smaller than PNG files
- Transparency Support: No
- ISO Standard: ISO/IEC 10918
- First released: 1992
JPG is possibly the most used image file format. It was created in 1992 and is interoperable – i.e. it can be viewed on many different devices, and programs – it is not vendor specific. It has become the standard for image compression and is widely used as the file format to share images, and display them as web content.
This is because JPG file format provides compression – it compresses the pixels and image information using DCT and offers a typical compression ratio of 10:1. For example, if you had a 10MB image, and converted it to a JPG, the resulting file size would be 1 MB.
The compression is complex, but it can be described as thus – the algorithm analyses the whole image. It then determines which pixels are similar enough that they can be merged and combines them into tiles. The result is a much smaller file size, with an imperceptible loss of quality.
However, this type of compression has a drawback – .JPG images are lossy. This means that each time the file is compressed and saved, data (i.e. pixels) is lost. So, every time the file is saved, the quality ultimately degrades – the process could be compared to photocopying a photocopy.
- Stands for: Portable Network Graphics
- Compression Type: LZW Compression
- Quality Loss: Lossless
- File Size: Larger than JPG
- Transparency Support: Yes
- ISO Standard: ISO/IEC 15948 / IETF RFC 2083
- First released: 1996
PNG file format or Portable Network Graphics is the other most commonly used image format. It was created in 1996 and is also used for a myriad of purposes. Like JPG, it is interoperable and an open file format – this means that it can be viewed on a range of different programs and applications.
Also like .JPG, PNG images format provides compression which results in much smaller file sizes, compared to a PSD file, for example. Due to the compression method, however, PNG files are generally larger in size than JPG.
PSD files use LZW compression – this is a form of lossless compression as opposed to the lossy compression of JPG. The LZW compression method uses a complex process of code string matching to compress the image, whilst still retaining its original quality.
Whereas JPG files degrade in quality each time they are saved, PNG files do not – the quality remains consistent.
The other main difference is that PNG files support transparency. Both color and grayscale pixels in PNG images can be transparent. This means you can use PNG file format to merge graphics seamlessly into background objects. For example, you could create a company logo as a .PNG file, and then overlay this onto any web content, without worrying about matching the background color.
Which is the best file type to use: PNG or JPG
So which file type should you use in different circumstances? We have listed some of the common uses for digital images, and which file type would be suitable below:
|Situation||Suitable File Type|
|Sharing images via social media||JPG|
|Taking screenshots for annotation||PNG|
|Web graphics (i.e. logos and buttons)||PNG|
|Web images (i.e. photos and header images)||JPG|
|Images with text||PNG|
PNG vs JPG: Generally speaking
- When a smaller file size is imperative, .JPG is the better choice due to its higher rate of compression without huge loss of quality
- When detail and quality is imperative, .PNG is the better choice due to its lossless compression, and support for transparency.
- Images with text should generally be saved in PNG file format. This is because the PNG file format can render text in a better way – if you save an image with text as a JPG, you will notice that the edges of the text appear jagged – this is due to a lack of anti-aliasing.
There is no right or wrong answer. You must consider the individual situation and look at what the image is required for, and how it is used. A simple rule to remember that often works, is that JPG images are suited for photographs, whilst PNG images are suitable for graphics and screenshots.
We hope you have found this article dedicated to PNG vs JPG topic interesting. You should now have a clear idea of what PNG or JPG image formats have to offer. Furthermore, you should understand appropriate usage and which file format is better suited in certain situations. Use WinZip free alternatives if the images are too large and you wish to save up some space on your computer by compressing them.
It’s my personal experience that if the photo dimensions are small then PNG is better as it is lossless.