3 ms·
Here it is, in its full glory! <?xml version="1.0" encoding="utf-8"?> <svg viewBox="0 0 100 100" width="100" height="100" xmlns="http://www.w3.org/2000
by phoe-krk 3y ago
Here it is, in its full glory!
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 100 100" width="100" height="100" xmlns="http://www.w3.org/2000/svg">
<rect x="0" y="0" width="100" height="100" fill="rgb(255, 102, 0)"></rect>
<path d="M 50 77 L 50 50 " fill="none" stroke="rgb(255, 255, 255)" stroke-width="8.78662150719729" stroke-linecap="butt">
</path>
<path d="M 94.93056731583404 35.622745513916016 L 71.2454833984375 71.2454833984375 " fill="none" stroke="rgb(255, 255, 255)" stroke-width="8.78662150719729" stroke-linecap="butt" transform="matrix(1 0 0 1 -21.2455 -21.2455)">
</path>
<path d="M -78.93056731583404 36.17028045654297 L -55.67118835449219 71.79300689697266 " fill="none" stroke="rgb(255, 255, 255)" stroke-width="8.78662150719729" stroke-linecap="butt" transform="matrix(1 0 0 1 105.396 -21.7213)">
</path>
<rect transform="" width="100" height="23.742591024555463" stroke-width="1" stroke="none" fill="#FF6600" stroke-opacity="1" fill-opacity="1" stroke-linecap="butt" stroke-linejoin="miter" >
</rect>
</svg>
- goodrubyist 3y agoso many butts!
- 5- 3y agothat's a lot of svg! svgo suggests the following without any manual tinkering: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="#F60" d="M0 0h100v100H0z"/><path fill="none" stroke="#FFF" stroke-width="8.79" d="M50 77V50m23.69-35.62L50 50M26.47 14.45l23.25 35.62"/><path fill="#F60" d="M0 0h100v23.74H0z"/></svg>
- willis936 3y agoTransport compression should get it most of the way there, no? I think having human readable vector graphics is nice.
- kashnote 3y agoThis the most HN string of replies I've seen. Cheers haha
- h0l0cube 3y agoApart from being one-lined, the optimised version is more readable and roughly about as compressible. There’s really no reason to have transformation matrices for 2 squares and a simple polygon
- tomxor 3y agotransport compression isn't going to help with the unnecessary high precision coordinates. There are also a bunch of things that are just the result of it being automatically generated by some vector package, such as the transforms, separate paths, masking of a bunch of strokes rather than just flattening the shape etc.
- tomxor 3y agoI see your 258 byte svgo version and raise it my 171 byte hand optimized version: <svg viewBox="-32 -32 64 64" xmlns="http://www.w3.org/2000/svg"><path fill="#f60" d="M-32-32h64v64h-64z"/><path fill="#fff" d="m0-5l-8-12h-7L-3 1v16h6V1l12-18H8z"/></svg>
- tomxor 3y agoBetter still, an inline SVG fragment is only 151 bytes - and will save 318 bytes of http header: <svg viewBox="-32 -32 64 64" width=18 height=18><path fill=#f60 d="M-32-32h64v64h-64z"/><path fill=#fff d="m0-5l-8-12h-7L-3 1v16h6V1l12-18H8z"/></svg>
- turnsout 3y ago118, can we beat it anyone? <svg viewBox="-32 -32 64 64" style="background: #f60"><path fill="#fff" d="m0-5l-8-12h-7L-3 1v16h6V1l12-18H8z"/></svg>
- lights0123 3y agoIt doesn't need to be valid XML if you embed it in the HTML, which was their point.
- turnsout 3y agoEdit: I stand corrected, it does parse correctly when embedded in HTML!
- zimpenfish 3y agoBy the tiniest of margins, 115. Deleted two spaces and an `l`. Largely inspired by `svgo`. Using `rsvg-convert` to render them both to PNG shows identical output between this and the 118 version. https://rjp.is/hn-svg.html https://rjp.is/hn-svg.html seems to render them identically in Safari and Chrome. <svg viewBox="-32-32 64 64" style="background:#f60"><path fill="#fff" d="m0-5-8-12h-7L-3 1v16h6V1l12-18H8z"/></svg>
- jjcm 3y agoInteresting, I never realized the Y wasn't symmetrical. The left branch is slightly lower and to the left of the right branch in the Y. This also creates a gap in the center of it at high resolutions: https://i.imgur.com/vwPnz2j.png https://i.imgur.com/vwPnz2j.png If this wasn't intentional, here's a symmetrical version: <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"> <rect width="100" height="100" fill="#FF6600"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M62.1762 23.7426H72.6857L54.3948 51.6515V76.9391H45.6048V51.6554L27.3143 23.7426H37.8233L49.9988 42.3233L62.1762 23.7426Z" fill="white"/> </svg>
- TimTheTinker 3y agoPerhaps the asymmetry is there to subtly evoke a dip and recovery of a company's stock price. The subtext could be "we build resilient companies".
- Quindecillion 3y agoImperfections in vector images make me twitch
- throwaway290 3y agoFun fact: "Y" in your comment is not symmetrical either. Letter shapes are usually not symmetrical, Y/X/etc. even in gothic sans typefaces add asymmetries that make text easier to read.
- layer8 3y agoWhy use such un-round numbers though?