3 ms·
> images with alpha channel I’ve read about BPG before, but not sure I noticed alpha support. This is intriguing! I’m a bit curious: what are the use cases for
by dahart 8y ago
> images with alpha channel
I’ve read about BPG before, but not sure I noticed alpha support. This is intriguing! I’m a bit curious: what are the use cases for a lossy image with an alpha channel? BPG doesn’t have a lossless mode, does it? Games maybe?
And I love that it has both pre-multiplied and un-pre-multiplied storage. PNG’s un-pre-multiplied only is what prevents adoption of PNG for so many alpha related workflows.
- adsche 8y ago> BPG doesn’t have a lossless mode, does it? Acording to the linked site: "Lossless compression is supported."
- ehsankia 8y agoMost modern formats have both alpha and animation, support lossless and lossy, all while still getting better performance and compression than jpg/png. And even then, when it comes to replacing the old formats, it's still an uphill battle.
- cooper12 8y ago> what are the use cases for a lossy image with an alpha channel? Basically any image that's not flat and has a shape cut out of it (you can do this with CSS nowadays, but an alpha channel is cleaner and part of the image, allowing sharing/reuse). I personally would have loved it for old oval portraits for Wikipedia where I'd be able to make the background transparent. Currently, you have to use PNG which isn't lossy and doesn't lend itself to photographs.
- dahart 8y ago> Basically any image that's not flat and has a shape cut out of it My question was about lossy alpha specifically. I use alpha a lot, but I've never seen a production workflow that used lossy alpha. The alpha channel is more sensitive to compression artifacts because unlike a 3-channel sRGB image, you have no guarantees about how it gets used or what it's composited over. JPEG is designed with specific channel tolerances loosely based on the differences most humans can see in the red, green & blue channels. Since alpha applies to all channels of the background and foreground, you'd have to make extremely conservative choices with the compression. I'm not certain, but at first glance it appears to me that BPG with alpha has visible artifacts. When I look at the dice images here: https://bellard.org/bpg/gallery2.html https://bellard.org/bpg/gallery2.html the green one on the left has some severe banding in the edges where the one on the right is smoother.
- adamredwoods 8y ago> what are the use cases for a lossy image with an alpha channel? Yes, games. Web animation. Ad banners. I usually use 8-bit PNG with quantized compression ( https://pngquant.org/ https://pngquant.org/ ).