Reputation: 467
How can I convert an image into "data:image/svg+xml;base64"?
I have tried this, but it only generates a data:image/png;base64
. I would need data:image/svg+xml;base64
. Do I need to save it in a specific way in (example) Photoshop?
Upvotes: 2
Views: 9132
Reputation: 29022
data:image/png;base64
is for bitmap data (PNG) and
data:image/svg+xml;base64
is for vector data (SVG).
So you'd need a program to convert bitmap data (pixels) to vector data which is quite complicated.
The other direction (vector to bitmap) is easy.
The difference explained in short:
Upvotes: 5