4 ms·
SVG can contain images, including data URL ones, what's missing?
by speps 3y ago
SVG can contain images, including data URL ones, what's missing?
- tetris11 3y agoYou're right of course, it just feels like a waste of the spec to use it only to embed raster. Is there no gradient style that could be used to encode pixels, directly using the schema?
- simbolit 3y agoWhat do you mean by "waste of the spec"?
- tetris11 3y agoIts a vector graphic spec with support for raster embeddings. Using it to hold primarily raster data feels like an underutilisation of the vector capabilities. A PNG would have been better, but a PNG is not programmable, so I lamented the SVG spec not having a programmable bitmap, since lots of people use it for plotting data.
- solardev 3y agoThat seems like it would be a lot of duplication of effort. A vector format that also has its own raster codec (and having to deal with compression, different metadata, etc?). Seems like the worst of both worlds, vs just using Canvas to output programmable rasters. Different implementations/browsers already have enough trouble outputting SVG as it is, making it even more complex/powerful would be counterproductive, I think... There are also specialist tools for dealing with web raster layers, like in GIS: https://openlayers.org/en/latest/examples/raster.html https://openlayers.org/en/latest/examples/raster.html This just shouldn't be a job for SVG, IMO.