Giter Site home page Giter Site logo

javierbyte / pintr Goto Github PK

View Code? Open in Web Editor NEW
750.0 12.0 57.0 12.83 MB

Create single line illustrations from your pictures. Get a drawing, SVG or coordinates for a CNC.

Home Page: https://javier.xyz/pintr/

License: BSD 3-Clause "New" or "Revised" License

HTML 19.15% JavaScript 4.81% CSS 11.54% TypeScript 64.49%
pintr svg png draw vector art plotter axidraw generative svg-illustrations

pintr's Introduction

Turn your images into plotter-like line drawings, create single line SVG illustrations from your pictures.

All the processing is made locally, your images never leave your computer and you are free to use them as you please.

pintr

Examples

Plotter Art

Thanks @sableRaph for helping me create those. Using an AxiDraw.

axidraw-pintr.mp4

Animated Example

This is an exported SVG animated using Vivus.

pintr

How does it work?

  1. The image is normalized for brightness and transformed to grayscale. See canvasDataToGrayscale. I try to make the lightest zone white, and the darkest black.
  2. A point in the canvas is selected at random and a line starts looking for different paths to draw next. At each step, the pencil draws imaginary lines to different points of the image and asks itself which one of those points would make the drawing look more like the original image, then it picks that one, draws the line and moves the cursor. The amount of imaginary lines is controlled by the "definition" slider. More lines mean more precise (but less terrifying) images. See scan functions
  3. Lines are batched to be drawn and get flushed almost every frame.
  4. Results are exported as svg as a very simple polyline, see generateSvg. PNG export is taken directly from the canvas.

Pixel data and resizing were made using canvas-image-utils, better face definition using face-api.

pintr's People

Contributors

javawizard avatar javierbyte avatar uecarlos avatar

Stargazers

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

Watchers

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

pintr's Issues

running the app locally

Hi, thanks for the tool, it does create interesting graphics, is there a way to run the app locally?
thanks again

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.