Derasterizer, a raster image to SVG converter

22 views
Skip to first unread message

Matt Printz

unread,
Mar 7, 2013, 9:47:42 PM3/7/13
to atxhs-...@googlegroups.com
At Tuesday's open house a few of you saw my latest project, a raster image to SVG conversion app I wrote to make designs to etch with the laser cutter. I got a lot of questions about it, so I decided to send it out to the list.

I've put up a simple web app you can access here: http://svg.hipokrit.com/

Here are some sample svgs it has produced:
http://svg.hipokrit.com/handler.py/display?img=ATX_Hackerspace_logo.svg
http://svg.hipokrit.com/handler.py/fullsize?img=grumpcat.svg

If you're interested in the sourcecode, it's up on github at: https://github.com/mattprintz/derasterizer

Feel free to use this for your projects, and let me know if you have any feedback.

Matt

Bryan Bishop

unread,
Mar 7, 2013, 10:08:22 PM3/7/13
to atxhs-...@googlegroups.com, Open Manufacturing, Bryan Bishop, Matt Printz

Bryan Bishop

unread,
Mar 7, 2013, 10:20:27 PM3/7/13
to atxhs-...@googlegroups.com, Open Manufacturing, Bryan Bishop, Matt Printz
On Thu, Mar 7, 2013 at 9:08 PM, Bryan Bishop wrote:
> Seems to work alright with qr codes too:
> http://svg.hipokrit.com/handler.py/fullsize?img=download.svg
> .. for whatever that's worth :-).

At what point is it more efficient to vector cut a qr code, rather
than the actual text you want to communicate? Does anyone know how
long it takes to vector cut out some text, versus a qr code? I haven't
done any of the math, but it occurs to me that there might be a point
at which it would take longer to cut all of the circles than it would
to cut out the shapes for letters in a string of text in the first
place (just based on the entropy of qr codes, for example).

Dustin Silverman

unread,
Mar 7, 2013, 11:04:28 PM3/7/13
to atxhs-...@googlegroups.com
Well you could represent UTF8 as 8 dots arranged in 4 rows and 2
columns, I'd say that would always be more efficient than actually
cutting out letters.
> --
> You received this message because you are subscribed to the Google Groups "ATXHS Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to atxhs-discus...@googlegroups.com.
> To post to this group, send email to atxhs-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/atxhs-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Bryan Bishop

unread,
Mar 7, 2013, 11:11:34 PM3/7/13
to atxhs-...@googlegroups.com, Bryan Bishop, Open Manufacturing
Turns out there's a (probably) more efficient ways to laser cut qr
codes using a much simpler technique: "As Fred Trotter has pointed
out, QR codes contain stencil islands in unpredictable configurations.
QR_STENCILER automatically detects and bridges these islands, using
thin lines that are minimally disruptive to the highly robust QR
algorithm. It does so through the use of two basic image processing
techniques: connected component labeling (sometimes called blob
detection) and 8-connected chain coding (sometimes called contour
tracing)."

On Thu, Mar 7, 2013 at 10:04 PM, Dustin Silverman <defen...@gmail.com> wrote:
> Well you could represent UTF8 as 8 dots arranged in 4 rows and 2
> columns, I'd say that would always be more efficient than actually
> cutting out letters.

Consider the following payload sans quotes: "testing". The number of
strokes is 9 or 10 depending on what font you are using.

When you generate a qr code and run it through derasterizer, it's much larger.

http://svg.hipokrit.com/handler.py/display?img=testing.svg

This has 232 circles, which requires far more strokes (than 9 or 10)
for the laser cutter. (Of course, this is still faster than drawing a
raster qr code.) Oh well.

Matt Printz

unread,
Mar 7, 2013, 11:31:06 PM3/7/13
to atxhs-...@googlegroups.com, Bryan Bishop, Open Manufacturing
While these QR codes may not be the most efficient, I think the circular dots are pretty cool looking. Gives the code just an extra touch of style, while still being readable (by Goggles on my phone) at least.

Matt

Reply all
Reply to author
Forward
0 new messages