PNG to AVIF Conversion: What Are We Trading Losslessness For?
6 min read
Two different philosophies
The move between PNG and AVIF is more than a simple format change. The two formats' underlying philosophies are opposites.
PNG's promise: "I will store every pixel you give me exactly as it is." Lossless compression encodes the data more efficiently but discards none of it. No matter how many times you open and save the file, the image does not change.
AVIF's promise: "I will represent the same image with far less data." To do that, it calculates which information the eye finds hard to notice and throws it away. The result is dramatically smaller files.
These two promises cannot be kept at the same time. So when you move from PNG to AVIF you are making a trade. In this article we examine exactly what sits on each side of that trade.
What you give: pixel accuracy
When you produce a lossy AVIF, the encoder analyses the image and decides which information can be discarded. That decision is not random; it is based on the characteristics of the human visual system. Our eyes are poor at noticing certain kinds of detail, and the encoder aims precisely there.
As a result the image is no longer a one-to-one copy of the original. For most viewers it is imperceptible, but if you compare at the pixel level the difference is there, and it is permanent.
Where that loss becomes visible varies by content:
Almost invisible in photographic content. Natural texture, continuous colour transitions and noise are already "irregular" structures; the simplifications the encoder makes get lost inside that irregularity. At a sensible quality setting, product photographs, landscapes and portraits are indistinguishable from the original.
Can be visible in content with sharp edges. Fine text, sharp lines, small high-contrast detail. Here every discarded piece of information comes straight out of the crispness of some structure. At aggressive settings, the lettering in interface screenshots softens and thin diagram lines blur.
The critical point: this is a risk you can manage with the quality setting. At high quality values AVIF gives perfectly clean results even for this kind of content, and the file still stays smaller than the PNG. The problem comes from running blind batch conversions at a low setting.
What you get: efficiency
The gain you receive in return is real and substantial.
PNG is at its weakest with photographic content. Lossless compression cannot efficiently encode natural images where every pixel differs from its neighbour. That is why the PNG version of a photograph is surprisingly large.
AVIF, on the other hand, is optimised for exactly this content. The intra-frame coding of the AV1 codec can divide the image into variable-sized regions and, by trying many prediction strategies for each region, select the most economical description. That is why the size difference between PNG and AVIF is striking with photographic content.
In a web context this translates directly into page speed. Smaller images mean faster-loading pages and less bandwidth.
What you do not lose: transparency
This is the most encouraging part of the switch, and it often gets overlooked.
A great many people use PNG for transparency. Historically, if you wanted transparency you had to stay lossless, because JPG does not support an alpha channel.
AVIF removes that dilemma. It fully supports the alpha channel — both fully transparent areas and the partial transparency of soft edge transitions are preserved. So you are not condemned to large files just because you need transparency.
For logos, product images with the background removed and overlaid graphics, that is a serious gain.
Lossless AVIF: refusing the trade
AVIF also has a lossless mode. In that mode the pixel data is preserved exactly as it is in PNG, and no information is discarded.
But the other side of the trade disappears too: in lossless mode most of AVIF's greatest strength, its size advantage, evaporates. What you get is much narrower compatibility in exchange for a limited gain over PNG.
That is why lossless AVIF does not make sense in most scenarios. If you want speed on the web, lossy mode is the right choice; if data integrity is mandatory, staying with PNG is usually more practical.
The right mental model
The healthiest way to understand this switch is to separate files by role:
Source (master copy): stays as PNG. It is lossless, open to editing, and the basis for producing other formats in future. It is never deleted.
Delivery copy: produced as AVIF. It is served on the web, it is fast, it is small. If it is lost or its quality proves insufficient, a new one is produced from the source.
Once that distinction is clear, the question "is moving from lossless to lossy bad?" loses its meaning. Your source is still lossless; only the copy you send to the visitor has been optimised.
The price not to forget: compatibility
This is the topic overshadowed by the quality debate but more serious in practice.
AVIF is a new format. Current mainstream browsers support it, but older devices, older operating systems, many desktop programs and some platforms do not. An AVIF file may not open at all on the other end.
The standard solution on the web is to offer a fallback format: HTML's picture element loads the AVIF if the browser supports it and the PNG or JPG version if it does not. That way you take the gain without taking the risk.
If you are sending the file directly to someone and you do not know their environment, think twice before doing the conversion — PNG's universal support is more valuable there.
In summary
Moving from PNG to AVIF is a trade of pixel accuracy for efficiency. With photographic content that trade is almost one-sidedly advantageous: a large size gain with no visible loss, and transparency preserved into the bargain. With content containing fine text and sharp lines you need to keep the quality setting high and check the result. In every case, keep the source PNG and offer a fallback format for compatibility — those two habits are how you stay on the winning side of the trade.
Frequently Asked Questions
Is moving from lossless to lossy always a bad thing?
No, depending on the context it can be an entirely sensible choice. Losslessness is not a virtue but a tool; its value only emerges where data integrity genuinely matters. When you serve an image on the web, what your visitor needs is not pixel accuracy but an image that loads fast and looks good. Keeping your source file lossless and producing the delivery copy as lossy is the standard approach that meets both needs at once.
Is AVIF's loss the same as JPG's loss?
Both are lossy, but they are not equally efficient. Because AVIF uses the far more advanced coding tools of the AV1 codec, it can represent the same level of visual quality with noticeably less data. In practice this means: at the same file size AVIF looks better than JPG; or at the same visual quality AVIF is much smaller. AVIF's degradation also has a different character and tends to appear as a softer form of loss rather than JPG's typical block structures.
For which content is this switch risky?
You need to be careful with images containing fine text, sharp lines and small high-contrast detail. Interface screenshots, text-heavy infographics and technical diagrams with thin lines fall into this category; at aggressive quality settings this kind of detail can soften and legibility can drop. With photographic content there is practically no such risk, because natural texture loss is far more forgiving. Using high quality values in the risky category, or considering AVIF's lossless mode, solves the problem.
If I convert to AVIF and then back to PNG, does the loss come back?
No, the loss is permanent and cannot be recovered by any conversion. A PNG produced from an AVIF stores losslessly whatever is inside the AVIF; that is, it freezes the image in its current state, including the existing compression degradation. The file size grows noticeably but the image quality does not improve at all. The only meaningful benefit of this conversion is preventing new generation loss if you are going to edit afterwards.
Try this out right away with PNG → AVIF Dönüştür.
Try PNG → AVIF Dönüştür