Vector images optimize for file size and flexibility. This is good for non-standard displays and network.
The network advantage is hard to disprove. But which has lower total computation cost?
A bitmap is created once, and the idea is very basic - you have a grid of pixels. The good part is that it's simple to use it. A vector image is a recipe for making an image. More calculations have to be done client-side, times the number of clients. Clients have to do the work the server didn't want to. You could say a bitmap is a compiled vector.
I think an ideal solution might be treating vectors as a source code. A web server would receive a request, including display size. Then it would "compile" the vector image into a bitmap and send the bitmap of the right size. And cache the image, so if another user with the same display size asks for the image, it's ready. Few people resize the browser window often. For the same reason, I think code highlighters shouldn't use Javascript on client side, unless the code might change (like, an in-browser REPL or pastebin).
Am I being misinformed? Pedantic? I like vector images, but would like to learn if my affection is justified.
They may not resize the browser window often, but when they do, it fires a lot of events with a lot of resolutions depending on how exactly they move the mouse to the desired position. Try opening your browser console, paste the code below, then resize a few times and see how many events you get.
You could do various techniques like detecting the start of resizing and waiting for it to settle down before requesting the new image, but still, I think you may be underestimating how many resolutions there are out in the wild :)
The network advantage is hard to disprove. But which has lower total computation cost?
A bitmap is created once, and the idea is very basic - you have a grid of pixels. The good part is that it's simple to use it. A vector image is a recipe for making an image. More calculations have to be done client-side, times the number of clients. Clients have to do the work the server didn't want to. You could say a bitmap is a compiled vector.
I think an ideal solution might be treating vectors as a source code. A web server would receive a request, including display size. Then it would "compile" the vector image into a bitmap and send the bitmap of the right size. And cache the image, so if another user with the same display size asks for the image, it's ready. Few people resize the browser window often. For the same reason, I think code highlighters shouldn't use Javascript on client side, unless the code might change (like, an in-browser REPL or pastebin).
Am I being misinformed? Pedantic? I like vector images, but would like to learn if my affection is justified.