Skip to content

Converts a live video stream into newspaper/print style Halftones

License

Notifications You must be signed in to change notification settings

brettcrowell/halftone

Repository files navigation

Halftone

Halftone is a Javascript experiment which converts a live video stream into newspaper/print style halftones. This is both an artistic venture, and a quest to create a super-slim codec-like transport format.

Getting Started

This project was recenty (10/2016) translated into ES6 and Webpack. Therefore, to get started, simply...

  1. Clone (or Fork & Clone) this repo
  2. Install Dependencies with NPM (npm install)
  3. Launch Webpack Dev Server to try it live...
./node_modules/.bin/webpack-dev-server

Reading the Data Format

The encoding process consists of splitting the source image into a grid and calculating the average luminance value for each quadrant based on converstion from RGB to HSL/HSV. These values range from 1 (completely dark) to 15 (completely light) and are represented by 4 bits each.

Original
Luminance (%) 0% 50% 100%
Luminance (bits) 0001 0111 1111
Result

Note that absolute darkness is represented by 0001 instead of 0000. This is because 0000 represents a quadrant that hasn't changed with regard to its value in the previous frame. Using 0000 for this purpose allows us to heavily compress the frame-difference using RLE.

Contributing

I'll check out your contribution if you:

  • Provide a comprehensive suite of tests for your fork.
  • Have a clear and documented rationale for your changes.
  • Package these up in a pull request.

I'll do my best to help you out with any contribution issues you may have.

License

MIT. See LICENSE.txt in this directory.

About

Converts a live video stream into newspaper/print style Halftones

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published