Text-based formats like XML and JSON are good if most of your data is strings, but storing numeric data in decimal strings is both inefficient and inaccurate. That's why I think that HTML is an appropriate use of XML-like markup but perhaps vector images would need a true binary version.
However I agree with saagarjha that it is very easy to write code to emit SVG, which is nice.
One could conceivably make a binary format based on Messagepack or Flatbuffers for vector data, which would be much more efficient and eliminate rounding problems of converting between floats and decimal numbers in text representations.
onion2k|5 years ago
SVGs aren't image data. They're a set of instructions for recreating image data using a structured language. XML is very good for data like that.
porphyra|5 years ago
However I agree with saagarjha that it is very easy to write code to emit SVG, which is nice.
saagarjha|5 years ago
mldbk|5 years ago
porphyra|5 years ago