2 ms·
Good call, when you need transparency it’s a much more meaningful gain. Heh, this is even another place where you can invoke SVG (though slightly less awful th
by chrismorgan 6y ago
Good call, when you need transparency it’s a much more meaningful gain.
Heh, this is even another place where you can invoke SVG (though slightly less awful than the HTML-in-SVG-in-HTML I just mentioned, yet nonetheless pretty unnecessary nowadays): you split the alpha channel out into a separate, greyscale, image, and use it as a mask for the other image. Thus you can add a PNG or JPEG alpha channel to your JPEG. https://peterhrynkow.com/how-to-compress-a-png-like-a-jpeg/ https://peterhrynkow.com/how-to-compress-a-png-like-a-jpeg/ is a good description of the technique; and JPNG.svg, at https://codepen.io/shshaw/full/LVKEdv https://codepen.io/shshaw/full/LVKEdv, is one tool to generate such things.
- Jiocus 6y agoSVG are absolutely an option and I've been meaning to go that route by default for some time, but old habits die hard. I mostly use them for icons, SVG feels saner than the alternative methods and easier to work with. Combined with design work it's convenient. Webp/png can be very useful in the sense that there is a broad understanding about how to work with plain images. A low barrier to entry, and easier collaboration in some situations. I did not know about the alpha channel workaround. That's nice to have in the toolbox, Thanks.