Giter Site home page Giter Site logo

sketcher's Introduction

Sketcher

Sketcher is an After Effects Plug-in that uses OpenGL to render lines & polygons over a footage's target color input to give it a sketch effect.

Sketcher effect on Build Our McQueen Footage

After Effects - Getting Started

Download/clone the repository. Locate the After Effects file location locally & place Sketcher.aex in Plug-ins > Effects.

Prerequisites

Download the following source files and place their .dll files in the System32 folder. In the Sketcher.sln file, set the Header Locations in Properties -> C/C++ -> General to the directory of these header files.

You will also need the AE SDK to run the files. Place the After Effects Plug-in folder in the Templates folder.

Modifying the Code

The sketcher algorithm is kept in the Sketcher.cpp & Sketcher_Helper.cpp files. To complile the plug-in, build the Sketcher.sln file in After Effects Plug-in -> Win.

Using the Plug-in

Sketcher comes with many parameters for customization.

  • Segments: number of points to draw.
  • Length: number of points per consecutive line.
  • Range: distance consecutive points of the same line can be from each other.
  • Straightness: length in degrees each angle of a line can make.
  • Drawing Mode: renders points, lines, or fills.
  • Line Color: color of the output.
  • Color Detector: input color.
  • Detector Range: range of acceptable input color
  • Spread: [debug-feature] how far apart lines would be.
  • Grid Selection: [debug-feature] selecting points in grid manner rather than at random.
  • Gap Selection: allowing lines to cross over gaps.
  • Random Seed: random seed.
  • Subject Layer: layer to apply the effect on.

For optimal performance, use an edge detection filter on the footage before applying Sketcher on a seperate adjustment layer

Processing - Getting Started

In SketcherApp.pde, insert the dimensions and name of the image. Be sure to place the image in the same directory of the .pde files.

  size(800,800);
 
  wth = width;
  hgt = height;
  String file = "flower";
  String filetype = ".jpg";

For batch processing, make sure your images are labled in ascending order with the number trailing the file name. For example, if you have 200 images of flowers, your images should be labled flowers0.jpg, flowers1.jpg, ..., flowers200.jpg. Change the indicies of the for loop to include all 200 images.

for(int i = 0; i < 1; i++) {
    String k = "0" + str(i);
    background(255);
    
    PImage img = loadImage(file + k + filetype);
  }

When drawing an image, you can choose between Path Forward & Point Forward point selection.

  • Path Forward - Finds first point on a line, searching for next point within radius of dist parameter.
  • Point Forward - Finds points at random, making sure the dist between points on the same line satisfies distance parameter.

To declare an instance, specify the point selection algoritm & include the image, number of points, distance between points, and scale (always 1).

PathForward p = new PathForward(img, 3000, 25, 1);
PointForward p = new PointForward(img, 3000, 25, 1);

sketcher's People

Contributors

cardadfar avatar

Watchers

James Cloos avatar

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.