├── LICENSE ├── README.md ├── filter list ├── index.html └── style │ └── style.css └── script ├── jsmanipulate.js ├── minified └── jsmanipulate.min.js └── separate filters ├── blur.js ├── brightness.js ├── bump.js ├── circlesmear.js ├── contrast.js ├── crosssmear.js ├── diffusion.js ├── dither.js ├── edge.js ├── emboss.js ├── exposure.js ├── filterutils.js ├── gain.js ├── gamma.js ├── grayscale.js ├── hue.js ├── invert.js ├── kaleidoscope.js ├── lensdistortion.js ├── linesmear.js ├── maximum.js ├── median.js ├── minimum.js ├── noise.js ├── oil.js ├── opacity.js ├── pinch.js ├── pixelation.js ├── posterize.js ├── rgbadjust.js ├── saturation.js ├── sawtoothripple.js ├── sepia.js ├── sharpen.js ├── sineripple.js ├── solarize.js ├── sparkle.js ├── squaresmear.js ├── threshold.js ├── triangleripple.js ├── twirl.js ├── vignette.js └── waterripple.js /LICENSE: -------------------------------------------------------------------------------- 1 | JSManipulate is licensed under the MIT License: 2 | http://www.opensource.org/licenses/mit-license.php 3 | 4 | Copyright (c) 2011 Joel Besada 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | JSManipulate 2 | ============ 3 | JSManipulate is an image filter and effects library written in Javascript for 4 | client-side manipulation of images on a web page. 5 | 6 | Version: v1.0 (2011-08-01) 7 | 8 | Developed by Joel Besada (http://www.joelb.me) 9 | 10 | Demo page: http://www.joelb.me/jsmanipulate 11 | 12 | MIT LICENSED (http://www.opensource.org/licenses/mit-license.php) 13 | 14 | Copyright (c) 2011, Joel Besada 15 | 16 | Usage 17 | ------ 18 | 19 | The filters are javascript objects all with a commonly named filter function. 20 | To use any of the filters, you need to input the ImageData object to be manipulated, and any 21 | optional extra parameters taken by the filter. To get the ImageData of an image, 22 | it needs to first be drawn on an HTML5 canvas object, from which you can use the 23 | getImageData function to retrieve the data. 24 | 25 | Here is an example of a common usage scenario: 26 | 27 | var canvas = document.getElementById('#your-canvas-element'); 28 | var context = canvas.getContext("2d"); 29 | 30 | //Get data for the entire image 31 | var data = context.getImageData(0,0,canvas.width, canvas.height) 32 | 33 | //Apply a Lens Distortion effect, with 3.0 refraction and a radius of 75. 34 | //The filter has two more parameters, centerX and centerY, but 35 | //all filters have default values for every parameter, so we can choose not 36 | //to specify these, leaving centerX and centerY at the default 0.5 value. 37 | JSManipulate.lensdistortion.filter(data, {refraction: 3.0, radius: 75}); 38 | 39 | //Now finally put the data back into the context, which will render 40 | //the manipulated image on the page. 41 | context.putImageData(data,0,0); 42 | 43 | If you are using any of the separate filters instead, note that you won't have a JSManipulate 44 | object, so to use the filter you will have to create an instance of that specific filter object: 45 | 46 | //Instead of JSManipulate.lensdistortion.filter(...); 47 | new LensDistortionFilter().filter(data, {refraction: 3.0, radius: 75}); 48 | 49 | You can check out all of the filters and their parameters in index.html in the filter list folder 50 | 51 | Samples 52 | --------- 53 | ### Photo Editing 54 | http://onlinephotomashup.com/ 55 | 56 | Are you using JSManipulate in a creative way in any of your web projects? Feel free to contact me on my 57 | Github profile and I'll make sure to include a link to your project here for everyone to see. 58 | 59 | -------------------------------------------------------------------------------- /filter list/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |