remy / inliner

Node utility to inline images, CSS and JavaScript for a web page - useful for mobile sites
MIT License
1.1k stars 165 forks source link

Inlining SVG will often lead to larger image #58

Closed remy closed 9 years ago

remy commented 9 years ago

See these assets: https://rawgit.com/hsablonniere/10c95896aaf9f1317246/raw/exploring-multiscreen-web-techniques.html

I took one of the SVG files, and compared the XML output (i.e. the SVG source) to the base64 encoded version. A 17K SVG comes out at 23K of base64 data. Not so good.

It would be good to inline to text on SVG - this should also allow the output to compress better too (as there will be repeating globs of symbols, rather than unique combinations of characters that make up the base64 string).

hsablonniere commented 9 years ago

Yeah, great idea ;-)

We'll have to only do it for img tags and not for CSS url()...

hsablonniere commented 9 years ago

Nice !!