Git Product home page Git Product logo

filterous's Introduction

Filterous

Filterous

Image manipulation library in JavaScript that applies filters to photos ร  la Instagram on browser. This script take pixel data from a photo that you want to give filter effects, and maniplute its pixels using the canvas element. The finished photo can be displayed as canvas, or as downloadable image formats such as jpeg, png, or webp for Chrome.

This works on modern mobile browsers as well.

Created by Tomomi Imura

Simple Demo

Filterous Demo

Real-life Example App

W3C CoreMob camera - Mobile Web App

Installation

Just include filterous.js in your HTML file.

<script src="filterous.js"></script>

Filterous does not require any other depencies.

Basic Usage

Create a new instance.

var f = new Filterous(imageObject);

Leaving the second param results a finished photo as a canvas, otherwise in a specified images format.

var f = new Filterous(imageObject, 'jpeg');

Apply a filter (or multiple filters) then render.

f.filterImage('brightness', 50);
f.render();

Examples of using other filters

f.filterImage('grayscale');
f.filterImage('rgbAdjust', [1.4, 1.2, 1]);
f.filterImage('convolute', [ 0, 0, 0,
                             0, 1, 0,
                             0, 0, 0 ]
);

or add an image layer:

var starryLayer = new Image();
starryLayer.src = 'effects/stars.png';

var f = new PhotoFilter(Filterous, 'jpeg');
f.applyLayer(starryLayer);
f.render();

Reset:

f.reset();

Using Presets (instead of defining filters manually)

  • Import filterousEffects.js.
  • Include the effects folder (contains the overlay image).
<script src="filterousEffects.js"></script>
ApplyEffects.nostalgia(imageObject, 'jpeg');

Take a look at the filterousEffects.js to see all available presets.

License

MIT License

Thank you

Thank you html5rocks.com for the tutorial on the pixel manpulating tutorials :-)

filterous's People

Contributors

girliemac 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.