Archive for the 'SVG' Category

JS PNG on GitHub

Wednesday, September 30th, 2009

In a continuing effort to make KevLinDev code more accessible, I’ve moved the JS PNG project to GitHub: JS-PNG. Quite honestly, I don’t recall why I even wrote this code. Most likely, it was just a curiosity to see if it could be done.

I was contacted by Paul Kienzle (sorry, no link), who is using this code for client-side rendering when other options (like canvas) are not available to him. He has made a number of optimizations which I hope he will be able to get up on GitHub, either in “master” or in a fork.

To give you an idea of Paul’s speed improvements, he’s seen original speeds of 1.8s for a 400×400 plot drop down to 0.25s. Amazing! However, it turns out that the actual decoding step performed by some browsers becomes the bottleneck. I would not have expected that.

JSDrawing on GitHub

Tuesday, September 29th, 2009

Earlier in the month, I moved the JSDrawing code to GitHub and I failed to mention that here. That project was really more of an experiment, or an excuse for an experiment, so I could test the Aptana JS Editor in the early days of its development.

This project uses my SVG path parser to fire events on a renderer as the path data is being parsed. The renderer uses the highest-order curves supported by a given target to plot whatever is being asked of it. For example, if a render target supports only moveto and lineto drawing primitives, the renderer will tesselate beziers thus adding support for those curves where they didn’t originally exist. It’s pretty rough, but I was able to render to DIVs, Flash, inline SVG, and VML, in some cases using pre-exising libraries for the actual renderering.

I had all sorts of plans for the code, but, alas, time isn’t alway cooperative. One area I thought would be interesting in which to experiment would be to convert the stroke of a path to a path itself. In this sense, JSDrawing could be used as an effects pipeline, allowing for ideas like stroking a stroke, in the spirit of Vector Effects..and the end result could be in turn SVG itself. Anyway, JSDrawing might prove to be interesting to some folks out there. You can find that bits at JSDrawing on GitHub.

DigiMemo 692 to SVG Conversion Utility on GitHub

Sunday, September 27th, 2009

Hi Folks,

Long time, no blog. I guess that’s the nature of tech interests and all that. However, I’ve been delightfully surprised to continue to receive emails over the years from people that have found bits and pieces of the site useful…even after begin dormant for almost 6 years!

In an effort to increase visibility of some of the more interesting code on KevLinDev and to make it easier for others to fork, branch, commit, etc., I plan to move bits and pieces to GitHub as time permits. And what better way to set priorities on what to move first than by basing my list on the gentle proddings of the emails I receive?

The first item to move to GitHub is my DigiMemo 692 DHW file format conversion utility which was discussed in Christmas Fun. This was one of those hey-wouldn’t-this-be-neat ideas where a few hours later I ended up with a utility to take my horrible handwriting and drawings and then convert them to SVG. Well, it’s years later and now that code has been reborn on GitHub and lives at the following URL:

DM2SVG

The script is quite simple and could easily be converted to other languages. One thing I always wanted to add was animation showing the drawings as they were digitized over time. So, for those of you in this very much of a niche use-case, enjoy!

P.S. Thanks go to David Yonge-Mallo for reminding me of this project. He has a nice blog post up that uses a variant of my code to generate Jarnal files.