4 ms·
In theory, AVIF supports palette-based blocks, so it can express perfectly sharp edges and even transcode a GIF with perfect accuracy. In practice these modes a
by pornel 2y ago
In theory, AVIF supports palette-based blocks, so it can express perfectly sharp edges and even transcode a GIF with perfect accuracy. In practice these modes are not used.
A blurry alpha channel is just having soft edges. A naive encoder will cause some of the previously transparent background bleed into visible pixels, usually causing darkened halos around the edges. This is a common problem in video game assets, and the fixes are the same: either bleed color around the edges (make transparent pixels have the right RGB values), or use premultiplied alpha color space. AVIF (also in theory) supports marking images as having premultiplied alpha.
- jaffathecake 2y agoI didn't mention it in the article, but the web component supports premultiplied alpha https://github.com/jakearchibald/stacked-alpha-video?tab=readme-ov-file#transparency-looking-too-dark https://github.com/jakearchibald/stacked-alpha-video?tab=rea...
- USiBqidmOOkAqRb 2y agoVideo compression may only cause issues at the edges due to chroma subsampling, in which case bleeding chroma to transparent pixels would help. All other cases would be errors in the pipeline, such as incorrect gamma handling, wrong supersampling implementation, or mixing up whether content is premultiplied or not. Also premultiplication is just a way to cache the multiplication operation: // using normal image // note that everything after the plus depends entirely on the image out = current * (1-img.a) + vec4(img.r*img.a, img.g*img.a, img.b*img.a, img.a) // using premultiplied image out = current * (1-img.a) + img Which might make sense if you're drawing same bitmap very many times.