Project

vtracer

0.0
No release in over 3 years
Wrapper of rust VTracer library, converter of raster images (like jpg & png) into vector graphics
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 0.9.91
 Project Readme

Vtracer

This gem is a wrapper of a rust library VTracer.

Installation

Install the gem and add to the application's Gemfile by executing:

bundle add vtracer

If bundler is not being used to manage dependencies, install the gem by executing:

gem install vtracer

Usage

Vtracer.convert_image_to_svg("/path/to/file/input.jpg", "../can/relative/out_put.svg", layer_difference: 10, max_iterations: 25)

Options:

Option Description
colormode ("color", "binary") True color image color (default) or Binary image bw
color_precision (1–8) Number of significant bits to use in an RGB channel
corner_threshold (0–180) Minimum momentary angle (degree) to be considered a corner
filter_speckle (0–16) Discard patches smaller than X px in size
layer_difference (or gradient_step)(0–255) Color difference between gradient layers
hierarchical ("none", "stacked") Hierarchical clustering stacked (default) or non-stacked cutout. Only applies to color mode.
mode ("spline", "polygon", "none") Curver fitting mode pixel, polygon, spline
path_precision (integer ≥ 0) Number of decimal places to use in path string
length_threshold (or segment_length)(3.5–10.0) Perform iterative subdivide smooth until all segments are shorter than this length
splice_threshold (0–180) Minimum angle displacement (degree) to splice a spline

Learn more

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/OlegSavinov/vtracer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Vtracer project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.