What are the differences between JPG and PNG formats? Most people know that the png format allows you to save transparencies through its alpha channel, but there are other particularities between these two formats that will help you choose the best option depending on their use.

Size and quality
Before going into this aspect in depth, it is necessary to be clear that the JPG format is a format that entails a loss of quality each time it is saved, while the PNG format is a lossless format.
When we work with an image in PNG format, where we can clearly differentiate the number of colors, such as an illustration with flat colors, it will weigh less than in JPG with the same quality.
This is best seen in the example below:

As we can see, to obtain a good image quality, the best result is given by the PNG-8 format, with a weight 4 times less than in JPG format.
The difference between PNG-8 and PNG-24 is the color depth for each channel (If we work in RGB mode the image will have 3 channels: Red – Green – Blue).
With the PNG-8 format we limit the number of colors to 256. For the image we are using as a sample it is more than enough, however in other occasions it will be better to use the PNG-24 format since we have up to 16.7 million colors available.
On the other hand, for photographs in which it is impossible to count the number of spot colors, since there would be several thousand, the best option is to choose the JPG format, since the PNG format would be very heavy.
Let’s look at another example:

On this occasion, the PNG-8 option would be unfeasible because reducing the color limit to 256 would significantly affect the image quality.
Banding and bits
Banding is the effect that occurs when making a simple gradient where stripes appear that make the gradient not continuous. Surely you have encountered this setback and did not know what caused it, the answer is in the bits.
As we said before, the PNG format can contain 8 or 24 bits of depth that establishes the amount of colors plus an extra channel (alpha channel) of transparency. If we work with an image of 8bits depth we do not have a color range high enough to get a smooth gradient, hence we get the banding effect, however, from 16bits the banding is significantly reduced.
Well, the jpg format does not have support for working with more than 8bits depth, so we must work with other types of formats, such as PNG, which supports up to 32bits depth, although there are others such as the EXR format.
Therefore, if we need to edit an image it is better to work with a format that allows us to store 16bits per channel, in order to have a wider range of tonalities.
I hope that with this information you will be clearer about when to choose one format or another, depending on the needs of your project, either for a digital image or if you are working on a print project.
Categoría/s: Graphic design
Leave a Reply