Fwd: Derasterizer, a raster image to SVG converter

44 views
Skip to first unread message

Bryan Bishop

unread,
Mar 7, 2013, 9:49:53 PM3/7/13
to Open Manufacturing, Bryan Bishop
From the tool's docs:

"Converts a raster image to a SVG image by converting blocks of pixels to an SVG circle with a radius based upon the average pixel values of the block."

From: Matt Printz <hipo...@gmail.com>
Date: Thu, Mar 7, 2013 at 8:47 PM
Subject: [atxhs-discuss] Derasterizer, a raster image to SVG converter
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

--
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
http://heybryan.org/
1 512 203 0507

Bryan Bishop

unread,
Mar 7, 2013, 10:08:22 PM3/7/13
to atxhs-...@googlegroups.com, Open Manufacturing, Bryan Bishop, Matt Printz
On Thu, Mar 7, 2013 at 8:47 PM, Matt Printz <hipo...@gmail.com> wrote:

Seems to work alright with qr codes too:
.. for whatever that's worth :-).

Neat tool.

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).

Windell H. Oskay

unread,
Mar 7, 2013, 10:44:19 PM3/7/13
to openmanu...@googlegroups.com

On Mar 7, 2013, at 6:49 PM, Bryan Bishop <kan...@gmail.com> wrote:

> From the tool's docs:
>
> "Converts a raster image to a SVG image by converting blocks of pixels to an SVG circle with a radius based upon the average pixel values of the block."
>

I'm sure that they're aware of it as well, but there's also Potrace, the raster-to-SVG/EPS/PDF converter that has been built into Inkscape:
http://potrace.sourceforge.net



Windell H. Oskay, Ph.D.
Co-Founder and Chief Scientist
Evil Mad Scientist Laboratories
175 San Lazaro Ave, STE 150
Sunnyvale CA 94086
http://www.evilmadscientist.com/

Bryan Bishop

unread,
Mar 7, 2013, 10:46:55 PM3/7/13
to openmanu...@googlegroups.com, Bryan Bishop, Windell H. Oskay
On Thu, Mar 7, 2013 at 9:44 PM, Windell H. Oskay <win...@oskay.net> wrote:
> I'm sure that they're aware of it as well, but there's also Potrace, the raster-to-SVG/EPS/PDF converter that has been built into Inkscape:
> http://potrace.sourceforge.net

How well does it compare to autotrace?

http://autotrace.sourceforge.net/

Have you used either of these? I actually didn't know that about inkscape.

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.
Reply all
Reply to author
Forward
0 new messages