Hacker News new | comments | show | ask | jobs | submit login

I guess Wikipedia's approach is a fairly good one here: Use SVG behind the scenes and generate PNGs for the articles themselves in the necessary sizes. Fast display of PNGs (also for complex imagery they tend to be smaller, but that's often just because Inkscape's default SVGs are horribly bloated¹) and the vector image for easy changes and printing.

That being said, back then I struggled fairly often with annoying bugs in Wikimedia's backend renderer rsvg. It got better over time but back then browser support was also very spotty. By now SVG is still my favorite vector format to use, mainly because it's trivial to write scripts around (it's just XML after all) and converting to PNG if you need it (or whatever else is needed) is trivial.²

So generally I'd say SVG is very much not dead, it's just rarely used directly on the web, except for interactive things where hit-testing arbitrary shapes is important.


¹ I used to vectorize a few (around 200–300, I think) flags on Wikimedia Commons and for simple shapes I concentrated on it was usually a difference of 350 bytes vs. 2–3 KiB. I wrote my code by hand for the most part, utilizing a few templates for common flag formats (n horizontal or vertical stripes, checkerboard, etc.) and small scripts for the more annoying things to write by hand, like wavy lines.

² Current use case from today: action bar icons on Android. When creating them in Eclipse from an image it only generates enabled, not disabled icons and I have to remember what padding I used and select the correct theme. After two or three changes in the source images (which were SVG anyway) it was enough and I just wrote a tiny script to generate them. Another use case were the images in my final thesis which I kept in SVG because back then I wasn't sure yet whether to use Word (needs EMF) or LaTeX (needs PDF) for writing. The fact that I needed Graphviz a lot which outputs nice, clean SVG also helped.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact