Giter VIP home page Giter VIP logo

gray2vec's Introduction

gray2vec grayscale image vectorizer using pixel aligned halftoning

This tool produces a polygon set from a grayscale image using halftoning.

The polygons are pixel aligned so when rendered with AGG based renderers (as well as many other rendering engines) the result will approximately match the input image being used as a coverage mask.

The output polygon grid has half the linear resolution of the input image.

The process used tries to minimize data size while maintaining consistency with the input data in terms of pixel coverage. It also tries to maintain some similarity regarding the topological configuration (as present in the double resolution input data).

Grayscale source raster

Generated vector data

Compiling the program

Internally the tool uses some code and components from GDAL 2. To allow building it with GDAL 1 the source file gdalrasterpolygonenumerator.cpp (from GDAL 2.1.1) is included in the repository - building and linking this should only be required for GDAL 1.x

Dependecies: GDAL and CImg.

Program options

The program offers the following command line options:

  • -i input image (required)
  • -o output vector file (required)
  • -c combined input image - to generate accurate output with several layers (optional)
  • -l output layer name. Default: polygons.
  • -x x attribute to apply to generated polygons (integer value, optional)
  • -y y attribute to apply to generated polygons (integer value, optional)
  • -z z attribute to apply to generated polygons (integer value, optional)
  • -complement process complement (inverse) of input. Default: off.
  • -append append to existing output file. Default: off.
  • -me maximum error to accept for pixel coverage fraction. Default: 0.05.
  • -debug generate additional debug output. Default: off.

##Legal stuff

This program is licensed under the GNU GPL version 3.

Copyright 2016 Christoph Hormann

gray2vec's People

Contributors

imagico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sybil12 weexp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.