GithubHelp home page GithubHelp logo

iolufemi / jquery-filter.me Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matthewruddy/jquery-filter.me

0.0 2.0 0.0 533 KB

Filter your images using Canvas, Photoshop Curves & jDataView.

jquery-filter.me's Introduction

jQuery filter.me

Filter your images using Canvas, Photoshop Curves & jDataView

jQuery filter.me is a jQuery dependant script that allows you to apply filters to images using Photoshop .acv Curves Adjustment files. jDataView is used to read the Photoshop file, from which we create a Monotonic Spline Curve representing its data. From this curve the new pixel RGB values can be calculated. These values are then applied using HTML5's canvas element.

Literally any Photoshop curves file can be applied to multiple images with ease. This is a great alternative to using something like PHP's imagemagick to try and replicate similar filtering. It can sometimes be a little slow, especially in mobile browsers, but I'm sure this will improve as canvas becomes more mainstream.


Usage

Versions available

Two versions are available, so have a look below.

  • Production - This version doesn't read the curves files, and only contains one script. Instead, the RGB values for each filter have been hardcoded into the script, speeding things up but preventing you from using your own curves (.acv) files. Requires only jquery.filterme.js.
  • Development - Contains all of the scripts, reading the curves (.acv) files each time the page is loaded. This takes a little longer (more files to load), but allows you to apply your own new filters easily (no need to calculate RGB values). This is where the real magic happens. Requires jDataview.js, jspline.js and jquery.filterme.js.


Applying a filter

Adding the filters is easy. As normal, you'll have to load the scripts (and jQuery) into your site's <head> or in the footer before the </body>. To intiate the filters, use the script below:

<script type="text/javascript">
jQuery(document).ready(function($) {
    $('.filter').filterme();
});
</script>

Then we add the filter class to the image, alongside the filter data attribute.

<img src="photo.jpg" class="filter" data-filter="Nashville" />

And that's it. It should work immediately!


Additional Options

Below are the options you can set when initiating the plugin.

$('.filter').filterme({
    desaturate: false   // Value from 0 - 1. 1 equals full desaturation (black & white).
    curves: false       // Object of RGB values in production script, or string name of curves .acv file in development script. 
    vignette: false     // 'true' or 'false'. Add a vignette to the image.
    folder: 'acv/'      // Development script only. Location of the .acv folder, relative to the current file.
    debug: false        // Set to 'true' for script debugging. Logs information along execution in console.
});


Resources

Just some of the resources I've used to create jQuery filter.me. Wouldn't be possible without the great work of others!


Little about me

I'm a 19 year old aspiring entrepeneur and web developer based in Dublin, Ireland. Having decided to turn down university in Ireland & the UK, I've set out to pursue startup success and make great connections. Love creating things with emerging web technologies, just for the pure challenge of it!

Currently I'm working hard with my first major venture, Riva Slider, which has proven very successful so far. I also hope to create more awesome tools in the future, and to prove that there is a life outside of third level education for young tech entrepeneurs here in Ireland. Please follow me and Riva Slider on Twitter! Feel free to fire any questions my way, I'd be happy to answer them.

jquery-filter.me's People

Contributors

matthewruddy avatar

Watchers

James Cloos avatar Olanipekun Femi 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.