GithubHelp home page GithubHelp logo

geo-stark / colorcurve Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vaguilera/colorcurve

0.0 0.0 0.0 100 KB

A javascript color curve editor component

License: GNU General Public License v3.0

JavaScript 83.04% HTML 16.96%

colorcurve's Introduction

colorCurve.JS

A javascript [color curve] (http://en.wikipedia.org/wiki/Curve_(tonality)) editor component

The idea is to recreate the Color curves editor from Photoshop/Gimp in Javascript. The javascript code is based on GIMP curves code, so it have some improvement over the Adobe Photoshop's one.

You can see it live [here] (http://s.vaguilera.com/projects/colorcurve)

How do I use colorcurve.js?

Just include ColorCurve.min.js on your page and create a canvas for the curve. The canvas for the curve should be square (same width and height)

<script src="../src/Colorcurve.js" />
...
<canvas id="Curve" height="256" width="256"></canvas>   
...

Then, when page is loaded you should init the curve passing the name of canvas as a parameter and the callback function to call when the curve is modified.

var Curve
Curve = new ColorCurve('Curve', function(){  console.log('Curve modified');  });

Into the callback function you can access the values directly from the curve. The values are in 0-255 format

var Curve
Curve = new ColorCurve('Curve', function() { 
	console.log(curve.rgb[0]);
});

Running the included example

The project includes an example of three curves modifying the RGB channels of an image. To run the example in Chrome you need to put the html and scripts into a webserver. If you execute the example directly without a server, Chrome raises a Cross-Image exception loading the image.

TODO

  • draw an historygram in the canvas

colorcurve's People

Contributors

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