TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why have SVG images not yet replaced PNG on the web?

76 pointsby sekyover 11 years ago

34 comments

jahewsonover 11 years ago
Nobody has mentioned the abandonment of SVG 1.2 as a factor. It was dropped by the W3C and never implemented in any browsers. This not only stalled improvements to SVG 1.1 but created a situation where the editing software (e.g. Inkscape) allows the user to create files using SVG 1.2 features which are invalid in SVG 1.1.<p>The abandonment has resulted in much-needed improvements to SVG being delayed. The last full release of SVG was 1.1 which was in 2003, we won&#x27;t see another full release until SVG 2 which is expected in 2014, over a decade later!<p>Never mind the fact the browser implementations of SVG are still <i>riddled</i> with bugs and none are complete.
评论 #6473566 未加载
评论 #6472974 未加载
评论 #6472977 未加载
oofabzover 11 years ago
A vector format is insufficient to make an image look good at all resolutions. Without hinting, lines are not aligned to pixels, making them blurry.<p>We have solved this problem with fonts, but it is extremely complex, both for the artist and for the rendering code.
评论 #6471783 未加载
评论 #6471445 未加载
评论 #6473460 未加载
评论 #6471346 未加载
评论 #6471462 未加载
评论 #6471482 未加载
评论 #6471301 未加载
评论 #6473184 未加载
评论 #6471320 未加载
sambeauover 11 years ago
I use SVG a lot and I&#x27;d say the reasons are:<p>* Browser support is still new and in places still a little rough<p>* IE support has only recently arrived<p>* SVG creation tools are either rough or expensive<p>* SVG can create sub-Flash-like performance if used carelessly<p>* SVG has no detail optimisation (or detail hinting)<p>I think we&#x27;re about to see SVG usage pick-up steam now that IE has support and retina displays are becoming commonplace. Hopefully we&#x27;ll get the tools and performance we deserve.<p>I&#x27;m very hopeful for SVG in the next 18 months.
评论 #6472760 未加载
评论 #6473229 未加载
评论 #6471612 未加载
评论 #6471492 未加载
ygraover 11 years ago
I guess Wikipedia&#x27;s approach is a fairly good one here: Use SVG behind the scenes and generate PNGs for the articles themselves in the necessary sizes. Fast display of PNGs (also for complex imagery they tend to be smaller, but that&#x27;s often just because Inkscape&#x27;s default SVGs are horribly bloated¹) and the vector image for easy changes and printing.<p>That being said, back then I struggled fairly often with annoying bugs in Wikimedia&#x27;s backend renderer rsvg. It got better over time but back then browser support was also very spotty. By now SVG is still my favorite vector format to use, mainly because it&#x27;s trivial to write scripts around (it&#x27;s just XML after all) and converting to PNG if you need it (or whatever else is needed) is trivial.²<p>So generally I&#x27;d say SVG is very much not dead, it&#x27;s just rarely used <i>directly</i> on the web, except for interactive things where hit-testing arbitrary shapes is important.<p>____<p>¹ I used to vectorize a few (around 200–300, I think) flags on Wikimedia Commons and for simple shapes I concentrated on it was usually a difference of 350 bytes vs. 2–3 KiB. I wrote my code by hand for the most part, utilizing a few templates for common flag formats (<i>n</i> horizontal or vertical stripes, checkerboard, etc.) and small scripts for the more annoying things to write by hand, like wavy lines.<p>² Current use case from today: action bar icons on Android. When creating them in Eclipse from an image it only generates enabled, not disabled icons and I have to remember what padding I used and select the correct theme. After two or three changes in the source images (which were SVG anyway) it was enough and I just wrote a tiny script to generate them. Another use case were the images in my final thesis which I kept in SVG because back then I wasn&#x27;t sure yet whether to use Word (needs EMF) or LaTeX (needs PDF) for writing. The fact that I needed Graphviz a lot which outputs nice, clean SVG also helped.
MaxGabrielover 11 years ago
Re: the author&#x27;s experience with Android: Android 2.x doesn&#x27;t support SVG. It makes up 33% of the devices that visit the Google Play store<p><a href="http://caniuse.com/#cats=SVG" rel="nofollow">http:&#x2F;&#x2F;caniuse.com&#x2F;#cats=SVG</a><p><a href="http://developer.android.com/about/dashboards/index.html" rel="nofollow">http:&#x2F;&#x2F;developer.android.com&#x2F;about&#x2F;dashboards&#x2F;index.html</a>
评论 #6475869 未加载
qwerty_asdfover 11 years ago
Because parsing XML can become a bottomless pit of nightmares and sorrow. Unholy floating point calculations that make Baby Jesus cry.<p>Meanwhile, pixel rasters are a finite array of bytes, confined to specific dimensions and resolutions. Plain old integers in 24 bit color with an 8 bit transparency channel.<p>And, specifically with respect to PNG, those pixel values are compressed row-by-row, using the DEFLATE algorithm.
amadeusover 11 years ago
I&#x27;m surprised file size hasn&#x27;t been mentioned as a mother major reason.<p>With tools like ImageOptim, and ImageAlpha, you can make PNGs INSANELY small with 0 or an imperceptible loss in quality.<p>For example, PNGs do insanely well when you have few numbers of colors that are repeating often. I&#x27;ve had had images that were 640px by 960px (pixel style art) that compressed down to sub 3kb with no quality loss. Good luck getting that with an SVG.<p>(Yes, there are certain types of images that PNGs are a terrible solution for, however, really, what I mean here is, right tool for the job.)
risover 11 years ago
Answer: because there are plenty of things you simply can&#x27;t express in SVG with its current level of support across browsers.<p>e.g. no blend mode except &quot;normal&quot; really works reliably across browsers yet. And just a reminder: it&#x27;s 2013, everyone.<p>Next question...
评论 #6471233 未加载
评论 #6471188 未加载
评论 #6473073 未加载
marijnover 11 years ago
The responses here (so far) are mostly pointing out why SVG is not suitable for <i>all</i> situations. There are many images where<p>- SVG will be smaller than a bitmap<p>- The sub-pixel rendering isn&#x27;t really an issue (do you check that all the lines are aligned on pixels when you export something from illustrator?)<p>- No advanced&#x2F;poorly supported features are necessary<p>Platform support is still a stumbling block, but that will get better. I seriously considered going svg-only for the vector-friendly illustrations in the new edition of <a href="http://eloquentjavascript.net" rel="nofollow">http:&#x2F;&#x2F;eloquentjavascript.net</a> . But in order to not screw over people on old devices, I will probably use svg with png fallbacks instead.
评论 #6471406 未加载
drcodeover 11 years ago
I think SVGs have failed so far on the web because of a sort of &quot;paradox of choice&quot;: As soon as you use SVG images, you&#x27;ll be tempted to make them do things you can&#x27;t do with PNGs, but you still end up in a world of hurt if you attempt to do this.<p>Chiefly among these new features are (1) inlining directly into html (2) making them interactive via javascript.<p>Both #1 and #2 are possible in theory, but in my experience these features are very painful practice... both of these are still very buggy. That&#x27;s the problem with SVGs: Most of the new &quot;options&quot; they open up are still not ready for prime time.
评论 #6473092 未加载
ScotterCover 11 years ago
I would say the main reason is because there&#x27;s not a &#x27;Save As SVG&#x27; in photoshop. Most non tech people haven&#x27;t heard of SVG and by the time they have, they already have a process for making images and the switch doesn&#x27;t have enough apparent value on the surface.
评论 #6472230 未加载
etchalonover 11 years ago
Exporting a bitmap is easy, and will always look correct when rendered.<p>Exporting SVG is difficult, requires specific tools, and is gonna render differently depending on the browser.<p>SVG solved a problem exactly no one had.
评论 #6471587 未加载
JohnHaugelandover 11 years ago
1) Different browsers can render SVG pretty differently, especially where two regions are within a pixel of one another. If you have a blue rect next to a red rect with a yellow background, some browsers will render the middle line purple, some green, some orange, and some brown.<p>2) Pixel choices by vector renderers are generally dramatically worse than a human artist&#x27;s choices. We don&#x27;t want accuracy, we want perceptual emphasis. Look at NES Mario in your head, then look at the blur you&#x27;d get if you took a modern hi-res Mario and vector rendered it at that size. For icons, this can be murder.<p>3) IE &lt;= 8 is still a pretty significant chunk of your viewers.<p>4) There&#x27;s a lot of knowledge built up around how to work with pixel images, especially when sprite sheeting for performance. Much of that knowledge needs to be re-learned for vector. Even when it&#x27;s a good idea, many developers feel they don&#x27;t have the time for a knowledge overhaul.<p>5) A big chunk of the web is legacy sites. This is why you still see javascript in html comments, or the occasional isindex. They aren&#x27;t getting updated, pretty much ever.<p>6) For visually complex sites, SVG can still drag on budget and older mobile devices.<p>7) Older android had SVG turned off in Chrome.<p>8) It&#x27;s a lot harder to get vector artists than pixel artists; it&#x27;s a lot harder for artists to give developers SVG than pixel images.<p>9) Because it isn&#x27;t trendy yet.
anjcover 11 years ago
Because they&#x27;re completely different formats to be used for completely different purposes?
olegpover 11 years ago
Because most of the images out there are in pixel and not vector format. Converting the latter to the former automatically doesn&#x27;t always produce the desired results.<p>At <a href="https://starthq.com" rel="nofollow">https:&#x2F;&#x2F;starthq.com</a> we do use SVG for the logo and all icons. Falling back to PNG for older browsers requires a CSS hack though and that fails on some older mobile devices.
dmlorenzettiover 11 years ago
I used SVG to make some interactive demos of some methods for solving ordinary differential equations. At the time, I remember being frustrated by the poor documentation available for the scripting aspects.<p>Naturally, there are a number of web resources, but none of them felt authoritative (in the sense of complete coverage). Furthermore, they used different techniques, so it was hard to integrate code samples from different sources. Finally, some had outright errors (my vague memory is that some of this was due to the documentation being written before a working implementation was available).<p>All of this had the effect of making me feel like SVG was a bit of a backwater. I liked the technology, and was willing to use it since I had total control of the machine I was going to run the demo on. However, I didn&#x27;t feel comfortable with the idea that I could make the demos public and have them run anywhere.
crazygringoover 11 years ago
&gt; <i>For some time, all major browsers already support SVG.</i><p>Not time enough. Plenty of people still use IE8, which doesn&#x27;t.
评论 #6471509 未加载
JoelSutherlandover 11 years ago
IE8 doesn&#x27;t support SVG and still has nearly 15% marketshare in the US. This is essentially the entire reason.
egypturnashover 11 years ago
&quot;Why have SVG images not yet replaced PNG on the web?&quot;<p>I&#x27;m an artist who&#x27;s been using Adobe Illustrator as her primary medium for thirteen years. Here&#x27;s some reasons why my site is still serving up tons of bitmap images:<p>- Any interesting vector image will be a much larger file as an svg than a web-res png&#x2F;gif&#x2F;jpg.<p>- Sophisticated effects in AI can get lost in the transition to SVG. I don&#x27;t know if this is AI&#x27;s fault, SVG&#x27;s lack of support, or the fault of the various things rendering the SVG, and the first point leaves me disinterested in experimenting.<p>That said, I <i>have</i> been playing with using web fonts for sets of simple images.<p>Also, most of my artist friends are completely baffled by AI; they prefer bitmap programs like Photoshop, Sai, or Artrage.
neoviveover 11 years ago
The SVG spec has been around for so long, but the fact that it competed directly with SWF held it back. Adobe was a major proponent of SVG until they bought Flash and focused their efforts accordingly.<p>Although SVG is &quot;readable&quot; in a text editor, all but the simplest shapes are extremely complex and require the use of graphics editors such as Inkscape. Vector formats are definitely the future for source images as they can generate any size bitmap you need for any device. However, as a delivery format, SVG will likely be relegated to niche and specialized sites (e.g. data visualizations and animations) for quite a while.
pullerover 11 years ago
Because browser support is inconsistent, SVGs are often larger than equivalent than even lightly optimized PNGs, and it&#x27;s a lot easier to find or create raster images than to obtain high-quality vector art. Also, you actually often want different images at different scales, so that automatically scaling one image is not that big an advantage.<p>I want to use SVG, particularly in Javascript apps. It seems like a more elegant solution&#x2F;workflow for things like icons. It would certainly beat abusing fonts to put small images on a page. but it has sort of missed its opportunity.
bcrescimannoover 11 years ago
Let&#x27;s not forget the issue that scaling vectors does not necessarily mean scaling intent and communication. Vector imagery for some things sounds great; in practice, it doesn&#x27;t always come out as well as you&#x27;d hope--and certainly not as well as a hand-optimized set of work.<p>See: <a href="http://www.pushing-pixels.org/2011/11/04/about-those-vector-icons.html" rel="nofollow">http:&#x2F;&#x2F;www.pushing-pixels.org&#x2F;2011&#x2F;11&#x2F;04&#x2F;about-those-vector-...</a>
taf2over 11 years ago
We use SVG on our homepage via raphaeljs to draw the graphics showing marketing, phone calls, metrics, and insights... It was always my goal to one day animate it to help better explain our product, but for now I think it looks pretty good and the PNG version was larger in bytes when converted... the example is here: <a href="https://calltrackingmetrics.com/features" rel="nofollow">https:&#x2F;&#x2F;calltrackingmetrics.com&#x2F;features</a>
tmarthalover 11 years ago
I think that the web is slowly starting to adopt SVGs where it makes sense.<p>d3.js is bringing svg charting to the web in a major way. Most, if not all, modern web dashboards are using it.<p>Google Maps has been using SVG icons for custom markers for awhile, embedded into their json configuration. This may not be strictly &#x27;the web&#x27;, but it is a major component of online GIS applications.
eddiehover 11 years ago
Because IE 8 doesn&#x27;t support SVGs and still accounts for &gt;20% of desktop traffic (by some reports). Likewise, Android 2.x doesn&#x27;t support SVGs and accounts for some non-ignorable amount of mobile traffic.<p>Where I currently work we can&#x27;t support SVGs with some projects due to a bug in the middleware we&#x27;re mandated to use.
grogenautover 11 years ago
It&#x27;s pretty simple. People in charge of corporate logos want COMPLETE CONTROL over how they look. If a rendering engine can mess it up, they&#x27;re not going to use it. Thus PNGs. What you put into a PNG is what you get out. Not so with SVG.
Grue3over 11 years ago
Because they are completely different image formats for completely different purposes! I&#x27;m so tired of these articles. PNG vs JPG, Animated GIF vs video, Flash vs HTML5. These things have barely anything in common!
zach_sover 11 years ago
Because people haven&#x27;t caught on yet. Browsers will start to support it and it will catch on once people realize its vast benefits over PNG. For now, it&#x27;s not worth it for people to switch.
brianfryerover 11 years ago
If you&#x27;re going to use SVGs, might as well make a font out of it. Otherwise, PNG is the way to go to guarantee uniform display.
评论 #6474165 未加载
nyarover 11 years ago
Easy answer - when you&#x27;re making an image in photoshop and you go to save it you don&#x27;t get to save it as .svg
ronreiterover 11 years ago
Because you need both raster and vector images. You can&#x27;t just ignore all pixel based images.
aidenn0over 11 years ago
SVGs are more expensive to decode: The law of spline demand.
drill_sargeover 11 years ago
you could ask the same question for .gif, flash video, mp3, mpeg2, analog tv&#x2F;radio, pci bus, d-sub...
deletesover 11 years ago
&gt;&gt;as PNGs are just plain bitmaps&lt;&lt; .png is definitely not a plain bitmap.<p><a href="http://en.wikipedia.org/wiki/Portable_Network_Graphics#Compression" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Portable_Network_Graphics#Compr...</a>