Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/polettix/graphics-potrace
Perl bindings for Potrace
https://github.com/polettix/graphics-potrace
Last synced: 3 months ago
JSON representation
Perl bindings for Potrace
- Host: GitHub
- URL: https://github.com/polettix/graphics-potrace
- Owner: polettix
- Created: 2011-03-11T22:16:58.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2016-09-12T20:14:37.000Z (over 8 years ago)
- Last Synced: 2024-04-17T21:17:30.657Z (9 months ago)
- Language: C
- Homepage: http://potrace.polettix.it/
- Size: 154 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
NAME
====Graphics::Potrace - bindings to the potrace library
SYNOPSIS
========# Step by step
use Graphics::Potrace qw< raster >;
my $raster = raster('
..........................
.......XXXXXXXXXXXXXXX....
..XXXXXXXX.......XXXXXXX..
....XXXXX.........XXXXXX..
......XXXXXXXXXXXXXXX.....
...XXXXXX........XXXXXXX..
...XXXXXX........XXXXXXX..
....XXXXXXXXXXXXXXXXXX....
..........................
');
my $vector = $raster->trace();
$vector->export(Svg => file => 'example.svg');
$vector->export(Svg => file => \my $svg_dump);
$vector->export(Svg => fh => \*STDOUT);# There is a simpler way to get a dump in a scalar
my $eps_dump = $vector->render('Eps');
# All in one facility
use Graphics::Potrace qw< trace >;
trace(
raster => '
..........................
.......XXXXXXXXXXXXXXX....
..XXXXXXXX.......XXXXXXX..
....XXXXX.........XXXXXX..
......XXXXXXXXXXXXXXX.....
...XXXXXX........XXXXXXX..
...XXXXXX........XXXXXXX..
....XXXXXXXXXXXXXXXXXX....
..........................
',
vectorial => [ Svg => file => 'example.svg' ],
);
# There is a whole lot of DWIMmery in both raster() and trace().
# Stick to Graphics::Potrace::Raster for finer control
use Graphics::Potrace::Raster;
my $raster = Graphics::Potrace::Raster->load(
Ascii => text => '
..........................
.......XXXXXXXXXXXXXXX....
..XXXXXXXX.......XXXXXXX..
....XXXXX.........XXXXXX..
......XXXXXXXXXXXXXXX.....
...XXXXXX........XXXXXXX..
...XXXXXX........XXXXXXX..
....XXXXXXXXXXXXXXXXXX....
..........................
',
);
# you know what to do with $raster - see above!DESCRIPTION
===========[Potrace](http://potrace.sourceforge.net/) is a program (and a library)
by Peter Selinger for *Transforming bitmaps into vector graphics*, distributed
under the GNU GPL. This distribution aims at binding the library from Perl for
your fun and convenience.ALL THE REST
============Want to know more? [See the module's documentation](http://metacpan.org/release/Graphics-Potrace) to figure out
all the bells and whistles of this module!Want to contribute? [Fork it on GitHub](https://github.com/polettix/Graphics-Potrace) or at least
[read the relevant page](http://potrace.polettix.it/).That's all folks!