I played with your concept awhile back. I found autotrace.

Then I used the following script to convert.

Gtk2 also has SVG capabilities, see Gnome2::Rsvg

#!/usr/bin/perl use warnings; use strict; use Image::Magick; my $infile = $ARGV[0]; (my $filebase) = $infile =~ /(.*)\.(\w+)$/; my $p = new Image::Magick; $p->Read($infile); my $outbmp = $filebase.'.'.'bmp'; $p->Write($outbmp) or warn "@!"; my $fin = $outbmp; my $fout = $filebase.'.svg'; my @options = qw( --despeckle-level 8 --corner-always-threshold 60 --corner-surround 60 --tangent-surround 3 --color-count 256 --corner-threshold 100 --despeckle-tightness 2 --error-threshold 2 --filter-iterations 4 --line-reversion-threshold .01 --line-threshold 1 ); system ("./autotrace --output-format svg --output-file $fout @options + $fin"); __END__ adjColor = gtk.Adjustment(256, lower=0, upper=256, step_incr=1, page_i +ncr=0, page_size=0) adjColAlwThresh = gtk.Adjustment(60, lower=2, upper=180, step_incr=1, +page_incr=10, page_size=0) adjCornSur = gtk.Adjustment(60, lower=2, upper=180, step_incr=1, page_ +incr=20, page_size=0) adjCornTh = gtk.Adjustment(100, lower=2, upper=180, step_incr=1, page_ +incr=10, page_size=0) adjDespLev = gtk.Adjustment(8, lower=0, upper=20, step_incr=1, page_in +cr=0, page_size=0) adjDespTig = gtk.Adjustment(2, lower=0, upper=8, step_incr=0.1, page_i +ncr=1, page_size=0) adjErrThr = gtk.Adjustment(2, lower=.1, upper=10, step_incr=0.1, page_ +incr=1, page_size=0) adjFiltIt = gtk.Adjustment(4, lower=1, upper=16, step_incr=1, page_inc +r=0, page_size=0) adjLineRevThr = gtk.Adjustment(0.01, lower=0.01, upper=0.16, step_incr +=0.01, page_incr=1, page_size=0) adjLineThr = gtk.Adjustment(1, lower=1, upper=20, step_incr=1, page_in +cr=0, page_size=0) adjTangSur = gtk.Adjustment(3, lower=1, upper=16, step_incr=1, page_in +cr=0, page_size=0) adjNumCol = gtk.Adjustment(0, lower=0, upper=256, step_incr=1, page_in +cr=20, page_size=0)

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: SVG manipulation by zentara
in thread SVG manipulation by martell

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.