TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

TinyVG – an alternative binary encoded vector graphics format

345 点作者 tsujp大约 2 年前

33 条评论

ot大约 2 年前
The author would make an even stronger case if they showed the results <i>after</i> compression. On the few examples in the home page, which I compressed with gzip -9 (zstd performs similarly):<p><pre><code> tiger.svg.gz 29834 tiger.tvg.gz 20533 app-icon.svg.gz 613 app-icon.tvg.gz 665 comic.svg.gz 25063 comic.tvg.gz 13262 chart.svg.gz 8311 chart.tvg.gz 5369 </code></pre> In most cases, even after gzip compression TVG still has a substantial lead over SVG.<p>This is evidence that the size improvement does not come entirely from the binary format (it would be possible to devise a binary format for SVG without changing the language and semantics), but from the simplified graphic primitives as well. If it was just XML overhead, compression should mitigate most of it.
评论 #35228689 未加载
评论 #35228601 未加载
评论 #35228948 未加载
oefrha大约 2 年前
By far the biggest advantage of SVG on the web is DOM integration, thanks to its choice of XML. This enables, among other things,<p>- Trivial adaptive styling: the simplest case would be matching color of surrounding text;<p>- Easy and relatively cheap dynamic updates to individual components, trivially integrated with any DOM-manipulation tech, including declarative frameworks big and small.<p>I don&#x27;t see a binary format easily replicating those.<p>Edit: Of course it&#x27;s okay to have more opaque binary formats.
评论 #35229240 未加载
archfrog大约 2 年前
Three cheers!!!<p>So fine with new and actually improved technologies instead of the many GUI rehashes that some companies make money off delivering all the time.<p>I don&#x27;t often use SVG, and am by no means an expert on it, but I dislike the experience every time. Like having to edit an .SVG file to fix a wrong displacement that places it a bit too far down. Trial and error, trial and error, until you randomly hit the spot that makes the thing begin to behave.<p>I think TVG popularity boils down to browser support and nothing else. I hope somebody with the skills picks up the task of integrating it into Chromium, then the rest of the world will bend and bow quickly.<p>Also, one might hope that a freeware GUI editor will see the light in not too long.<p>Perhaps the authors should do a new single-protocol Mail&#x2F;Calendar&#x2F;Contacts&#x2F;Notes&#x2F;etc. standard as well? I recall IMAP being a horribly clumsy and complex protocol, and didn&#x27;t Einstein say:<p><pre><code> Make it as simple as you can, but not simpler!</code></pre>
评论 #35228445 未加载
评论 #35228238 未加载
评论 #35228489 未加载
Dalewyn大约 2 年前
I&#x27;m going to sound like Richard Stallman, but being human-readable and Notepad-accessible is a <i>huge</i> advantage for SVG compared to this and its binary nature.
评论 #35228100 未加载
评论 #35250861 未加载
评论 #35238576 未加载
progx大约 2 年前
Senseless, if you not explain what will work with TinyVG and what will not work.<p>Tried some real life svg files from a current project, all failed: `Node has unsupported transform:` matrix, translate, Failed to translate color spec rgb, ... The transformed files are all larger.<p>All files are simple SVG without any special content. Exportet from Affinity Designer.
评论 #35230348 未加载
abdellah123大约 2 年前
SVG integrates with CSS, animations and is a 1st class citizen on the web.<p>I hardly see any way tinyVG (binary) could replace that. But for displaying vector graphics like images, size perf is great :)
nomercy400大约 2 年前
What part of SVG does TinyVG NOT support?<p>If I would want to replace my current usage if SVG with TinyVG I would like to know what isn&#x27;t supported, before I start replacing.
Pxtl大约 2 年前
A lot of people are defending SVG by pointing out how it integrates with CSS and JS the DOM and I&#x27;m like &quot;yes that&#x27;s why a simpler format is better&quot;. SVG is too powerful to use as a simple image format.<p>Everybody trusts user-uploaded JPGs. Trusting user-uploaded svgs is dangerous without detailed domain knowledge.<p>Json vs XML already demonstrated how less is more.<p>There are good reasons to enjoy the idea of a vector graphics equivalent to HTML just like there are good reasons to enjoy a vector graphics equivalent to PNG.
iainmerrick大约 2 年前
I want to like this more, but it doesn&#x27;t seem very compelling.<p>As others have noted, the size difference is essentially nil if you compare to a gzipped <i>minified</i> SVG (for which there are off-the-shelf tools).<p>No CSS means you can&#x27;t easily integrate with CSS animations.<p>The spec also seems unnecessarily quirky -- I would have expected it to be really, really simplistic and minimal, along the lines of <a href="https:&#x2F;&#x2F;qoiformat.org" rel="nofollow">https:&#x2F;&#x2F;qoiformat.org</a>. For example, there&#x27;s a header flag that sets the &quot;unit&quot; size to 1, 2 or 4 bytes; but <i>also</i> a variable-length encoding for values, so it seems like small uint32 units would mostly fit into 1 byte anyway. Only sRGB colors are supported -- why not linear?<p>I&#x27;d definitely prefer to write a renderer for TinyVG rather than SVG if I were working from scratch. But SVG exists and is pretty well-supported already so you don&#x27;t have to. (And if I enjoyed working with XML I might actually prefer SVG.)<p>Possibly TinyVG would be good for embedded systems? If there were a really small and fast implementation, <i>and</i> if anyone has a need for portable vector graphics on a system that can&#x27;t handle SVG.
评论 #35236478 未加载
IvanK_net大约 2 年前
If we ZIP both SVG and TVG, the difference is not that large anymore.<p>For most of people, wide support is more important than 20% smaller file size. That is why it is hard for WEBP to replace JPG.
评论 #35230579 未加载
winter_blue大约 2 年前
This looks pretty impressive. They&#x27;ve got an official specification up at: <a href="https:&#x2F;&#x2F;github.com&#x2F;TinyVG&#x2F;specification">https:&#x2F;&#x2F;github.com&#x2F;TinyVG&#x2F;specification</a><p>Also, interestingly, it&#x27;s written in Zig: <a href="https:&#x2F;&#x2F;github.com&#x2F;TinyVG&#x2F;sdk">https:&#x2F;&#x2F;github.com&#x2F;TinyVG&#x2F;sdk</a>
geokon大约 2 年前
&quot;SVG is a horribly complex format and an overkill for most projects&quot;<p>Can this be given more substance..?<p>Does it also apply to SVG v1.1 (Tiny&#x2F;Basic)? It seems to cover a similarity limited scope. From the landing page its unclear if its fundamentally doing something different. In my naiive perspective itd seem more sensible to just make a new way to encode SVG?
评论 #35228231 未加载
angelmm大约 2 年前
I always found SVG a non-readable file for most images I’ve used. Yes, if you place a simple rectangle it works, but when you export an image it’s almost impossible to edit it manually.<p>I like this edge on TVG, as a binary format is more optimal for size and you’re not losing much visibility on this case.<p>I believe TVG popularity will depend on the final use cases. Having to use a poly fill on the browser delays the reproduction of the image until JS is loaded. It would be interesting to compare both cases: download an optimized SVG vs download and print a TVG file using the polyfill.
评论 #35228298 未加载
est大约 2 年前
It compares only to SVG. How about other formats? e.g. Lottie-based .TGS format, Microsoft&#x27;s .EMF.
评论 #35232693 未加载
gardaani大约 2 年前
The spec v1.0 was written two years ago. Is anyone using this new file format?
dang大约 2 年前
Related:<p><i>TinyVG: A challenger to the throne of vector graphics</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=29629792" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=29629792</a> - Dec 2021 (187 comments)
userbinator大约 2 年前
There&#x27;s already a very good binary encoded vector graphics format, which also supports animation among other things --- SWF. The descriptions in this specification actually look somewhat like it.<p><i>The original SVG is 96,719 bytes large, while the optimized one is 85,806 bytes large. When converted to TinyVG, the file shrinks to 27,522 bytes. This means we only have 32% size of the optimized source data.</i><p>I have a tiger.swf which is 21381 bytes, and since there&#x27;s another comment here about gzip&#x27;ing them, tiger.swf.gz turns out to be only 17296 bytes. In conclusion, I think a subset of SWF, of which much existing rendering code is available, will provide much better efficiency and compatibility than this.
评论 #35231860 未加载
评论 #35232613 未加载
teaearlgraycold大约 2 年前
IMO binary encoded versions of files that are already small are more hassle than they&#x27;re worth. Now you need a specialized tool to view and edit the file. I have, on many occasions, edited SVGs manually in a text editor. Losing that is a big devex issue.<p>Having worked a bit with protobuf and CBOR in the last year - the binary encodings are a big pain in the ass. I understand that for massive companies the payoff could be worth it (although I think the people that decide to use proto&#x2F;CBOR don&#x27;t calculate the hours wasted on an obtuse encoding scheme), but <i>certainly</i> for small shops you&#x27;re wasting your time.
DeathArrow大约 2 年前
Is TinyVG faster to render than SVG? That would be a good justification to use it.
评论 #35228871 未加载
评论 #35229609 未加载
osswannabe大约 2 年前
Disclaimer: dumb questions ahead.<p>Who is this project intended for? I was under the impression that browsers and Adobe products implement their own VG renderers (not client-side JS code provided by websites).<p>If that&#x27;s correct, is this project trying to build a format that&#x27;s better than SVG and parseable out-of-the-box by those renderers?<p>Or is it trying to get browsers&#x2F;Adobe to extend their renderers to support TinyVG? If this is true and TinyVG isn&#x27;t supported yet, how was the website able to render that Tiger picture?
评论 #35240499 未加载
ha1zum大约 2 年前
I wish the website briefly list the features that exist in the SVG format but doesn&#x27;t exist in theirs, so I could see exactly what I&#x27;m missing. It could remove a lot of doubt to dip my toe if it turns out that I really don&#x27;t need the missing features.
al_be_back大约 2 年前
you get an edge over size with binary formats, but it&#x27;s a pain to edit on the fly - svg has relatively low barrier to entry in this respect.<p>perhaps a TVG niche could be around embedded, low-power, slow-connection devices where content is mainly read-only.
评论 #35236326 未加载
bigattichouse大约 2 年前
Been thinking about using webassembly to compile something like this, then you build the callouts to do the actual rendering... could potentially be even smaller. Compile TinyVG &gt; Wasm &gt; Wasm to bytecode.
veqq大约 2 年前
Does anyone know what the edge cases SVG concentrates on are?
FreeTrade大约 2 年前
Sounds a little like an early version of Flash. Size comparisons to SVG after compression would be interesting too as most Web assets will be delivered compressed.
Dork1234大约 2 年前
Are there any Python&#x2F;MicroPython libraries being worked on for this? This could be helpful for micro controller graphics.
nabla9大约 2 年前
How does TinyVG compare against WebCGM<p>Comparing binary format vector graphics against SVG as if there is nothing else seems weird.
1-6大约 2 年前
Seems like a good way to protect your vector graphics from being nabbed if it&#x27;s encoded in bin.
lalaithion大约 2 年前
The “plain text” spec is in a weird encoding, casing mojibake when I view it in my browser.
giomasce大约 2 年前
What features does it miss from SVG?
specialist大约 2 年前
Nice.<p>I like how styles are defined up top and referenced thereafter.<p>Maybe modify the header from &#x27;lisp&#x27; to a shebang, like:<p>#!tinyvg
b34r大约 2 年前
Good luck getting browser support so it’s actually usable
评论 #35232293 未加载
评论 #35233442 未加载
ar9av大约 2 年前
It seems lots of people are discovering that SVG is overkill for most applications. Here (<a href="https:&#x2F;&#x2F;docs.google.com&#x2F;document&#x2F;d&#x2F;1YWffrlc6ZqRwfIiR1qwp1AOkS9JyA_lEURI8p5PsZlg&#x2F;edit" rel="nofollow">https:&#x2F;&#x2F;docs.google.com&#x2F;document&#x2F;d&#x2F;1YWffrlc6ZqRwfIiR1qwp1AOk...</a>) is a document by the flutter devs where they outline a new format. I hope we won&#x27;t end up in a situation where there are 14 competing successor candidates for SVG.
评论 #35229921 未加载
评论 #35230851 未加载