3 ms·
And lay out your "images" via CSS and try to make it work on all browsers? On top of that, for a complex image, you'll end up encoding your image data in JS or
by IgorPartola 17y ago
And lay out your "images" via CSS and try to make it work on all browsers? On top of that, for a complex image, you'll end up encoding your image data in JS or HTML or some other text format, which would take up much more space than a format like JPG/PNG/GIF. Those formats are designed to handle images and that's all they do.
Plus, with JS you wouldn't necessarily get immediate rendering of the image, so you would be making the UX worse, not better.
- AndrejM 17y agoThat is not what I meant, actually. I meant rendering a logo via some paint methods, where all the information the methods have is some text, color and style attributes, etc. Then the logo gets drawn on-the-fly by the user's browser. It could work for simple logo's, I believe.
- IgorPartola 17y agoYes, but everything you describe can be done with CSS as well: loading custom fonts, background colors, even gradients.
- dhimes 17y agoThis is worth a try for a lot of reasons. If not for logos, then for buttons on your site. When I switched to painted buttons vs images in my downloadable desktop software, I (1) saved a lot of space on downloads, and (2) saved a TON of time whenever I wanted to add a new button or change the color scheme, or gradient, or shadow, etc. Re-creating each button (even just creating a new one) was a total pain in the ass compared to simply instantiating a new button or playing with the paint method. I haven't tried it in html5 yet, but if I use buttons on the page I will definitely give this a shot.