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.
This project was recenty (10/2016) translated into ES6 and Webpack. Therefore, to get started, simply...
- Clone (or Fork & Clone) this repo
- Install Dependencies with NPM (
npm install
) - Launch Webpack Dev Server to try it live...
./node_modules/.bin/webpack-dev-server
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.
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.
MIT. See LICENSE.txt
in this directory.