It’s just data

SVG Tidy

Normally, I hand craft my images using vim.  I also try to limit myself to 1K bytes.  I occasionally find it convenient to start from an existing image.  Sometimes that works out.  Sometimes it does not.

This image nearly did not work out.  In retrospect, I would have spent less time writing it from scratch, but some good did come of the effort.  But first, the problem.  Or rather problems.

The first problem can be illustrated by this excerpt:

<svg viewBox="0 0 128 102">
    <g transform="matrix(1.8,0,0,1.8,-556.831,-272.2498)">
      <g transform="translate(-44.25663,-9.440477)">
        <g transform="translate(-225.2675,-211.7949)">
          <path transform="matrix(0.738729,0,0,0.738729,168.6073,57.12999)"

What this defines is the width of a stroke (typically the border of a shape) to nine digits of precision.  And then specifies two scalings and four translations (movements about on the page) to be applied to the path.  All for a stroke that is none i.e. not to be shown at all.  I realize that the interior is filled, but why specify the stroke to so many digits of precision and have so many transformations defined?

But that’s just number crunching.  The second problem is that the icon is too busy and too detailed.  It doesn’t work well as an icon.  In fact, if shown full screen and centered on a 1080p widescreen display, there are a number of curves so delicate that they would not deviate by so much as one pixel from a straight line.  There also are a number of lines that would show up as zero pixels in length.  In fact, there even is one curve that also would not occupy any pixels at all.

I’ve not quite gotten this down to my self-imposed limit of one K bytes, but I am getting closer.  In the meanwhile, this effort has motivated me to collect up a number of my ad-hoc scripts that do various tedious number crunching exercises and package them up as a script.  I even have a spec written using bacon as bacon is known to work on Ruby 1.9.

While you should be able to use your choice of Rubies, you will need a recent version of REXML.  Preferably one from SVN.

"Normally, I hand craft my images using vim"

“Normally, I hand craft my images using vim” - Sam Ruby...

Excerpt from Application Error at

PrinceXML Is Extremely Impressive

I didn’t know it was possible to build such nice closed-source programs....

Excerpt from Ryan Tomayko at

You just converted the entire dev team at my office into SVG fanboys :-) ... thanks!

Posted by Charlie at

This is really cool but the only thing that I notice is that this is not working using the Internet Explorer but worked prefectly in my FireFox.

Posted by ChainsawCR at

"Normally, I hand craft my images using vim."

Normally, I hand craft my images using vim. – Sam Ruby is the ubergeek...

Excerpt from WHAT HAPPEN at

Sam Ruby: SVG Tidy


Excerpt from at

PrinceXML Is Extremely Impressive

I didn’t know it was possible to build such nice closed-source programs....

Excerpt from Ryan Tomayko's Writings at

Språkrådets m.fl. sitt forslag til et norsk ord for «feed»

Selv om jeg har lagt ut svaret tidligere så kan det kanskje være greit å lage en egen post....

Excerpt from Logg for Aslak Raanes at


Adobe Illustrator や Inkscape や sodipodi などのソフトで作った SVG ファイルは、不要な要素などが含まれていたりして、けっこうサイズが大きくなったりする。 SVG というのは単なるテキストファイルなので、普通にエディタで開いて人力でチマチマ頑張ればサイズを小さく...

Excerpt from by edvakf in hatena at

Sam Ruby: SVG Tidy

Sam Ruby: SVG Tidy...

Excerpt from NI-Lab.の電子栞 / svg (113) at

“Normally, I hand craft my images using vim.”

The above is a quote from Sam Ruby’s blog.  This deliciously innocent pedantry made me choke on my coffee in laughter....

Excerpt from deviled eegg at

Being in the market for 40 years, we are not just salespeople, but we understand what you require to work safely. With us, get the best help when it comes to choosing the right men to work shirts as we have for you designs and colours that would go with all kinds of the work environment. You could even buy Mens Work Wear with The Work Warehouse.

Posted by Mens Work Wear at

Looking for vehicles to hire? Look no further. Rarotonga car rental hires the best vehicles. You can get your cars soon as you land at the airport.

Posted by Rarotonga Airport Car Hire at

When you are looking for Cook Islands accommodation, then we provide you with budget hotels and resorts that would provide you with all the amenities. Check out our modern fleet of cars and bikes that we have for your ease while going for car hire in Rarotonga. With our stress-free rental plans and procedures, go for your rental car today.

Posted by Car rental in rarotonga at

Get the best & cheap prices for luxury car rental Dubai. With a large selection of luxury cars and locations throughout Dubai. Rent a luxury car today with Car Rental Dubai.

Posted by Car Rental Dubai at

Your post intrigued me a lot to learn more about it! keep posting,For more information visit my website:-

Posted by In house mental health first aid at

Very interesting blog! keep sharing with other people ,For more information visit my website:-
Bodytree Studio

Posted by Holistic health centre abu dhabi at

Hi I came across your blog , it’s really awesome , For more information visit my website:-
Health and Food

Posted by Naturopathy Parramatta at

Thanks for the incredible knowledge shared, truly eye opening! , For more information visit my website:-
The Workware House

Posted by Work Wear Online Sydney at

Add your comment