4 ms·
Selectively Compressed Images – A Hybrid Format
- jstanley 3y agoNice. If you gzip the SVG you'll probably get back most of what you wasted on base64.
- edent 3y agoThat's a good point. For transmission from a webserver, it probably doesn't make much difference if it is B64 or not.
- mthoms 3y agoI did a quick experiment. The results are interesting. The SVG file is 135k. The PNG inside it is 48kb when converted to binary. The JPG is 53kb, for a combined total of 101kb. With Brotli compression, the SVG comes over the wire in 94kb. So for this particular example, the SVG comes over in less bytes than the two original files would. Am I missing something? Notes: (1) The JPG is ridiculously compressed and there are artifacts galore so not the best test case (2) There was no savings sending the original two binary files with Brotli compression but from a quick search that appears to be normal. (3) I'm not sure how to just test gzip.
- compressedgas 3y agoThis trick of using SVG was previously used to create JPEGs with transparency.