Original picture

Original picture

Grayscale

Average

Grayscale by average

Natural

Grayscale by natural

Luminosity

Grayscale by luminosity

Lightness

Grayscale by lightness

Red

Grayscale by red value

Blue

Grayscale by green value

Green

Grayscale by blue value

Usage


Basics

Easy as possible, .grayscale() is enough!

$("#gray").grayscale();

Another grayscale? Add a parameter!


Effect

Usage


Inverse

If you want to inverse your image just do:

$("#inverse").effect({mode: "inverse"});

Solarize

Maybe you want to solarize?

$("#solarize").effect({mode: "solarize"});

Blur

Maybe you want to blur?

$("#blur").effect({mode: "blur"});

Inverse

Inverse

Solarize (less)

Solarize by less comparation

Solarize (greater)

Solarize by greater comparation

Solarize (limit)

Solarize with custom limit

Blur

Blur by default

Blur radius 5

Blur radius 5

Blur radius 9

Blur radius 9

Hue

Hue 180°

Hue of 180 degrees

Sat -55%

Hue -55% saturation

Value 40%

Hue +40% value

All

Hue 180 degrees, +55% saturation, -40% value

Usage


Basics

You need to rotate yours colors? You can use .hue(180) to rotate by 180 degrees!

$("#hue").hue({ mode: "add", hue: 180 });

Modes


Colorize

Usage


Basics

You need to colorize your picture? You can use .colorize()

$("#colorize").colorize({ mode: "add", r: 80 });

Modes

Colorize

Colorize

From gray

Colorize by gray

Replace

Colorize by replacing

Multiply

Colorize by multiplication

Custom

You can .save() and .restore() an image. (one save deep)

And also create .custom() function

$("img").save().custom(function(pixel, informations) {
    // pixel for the current pixel, informations for the image informations

    // pixel.x or .y for coordonates
    // informations.height or .width for dimension
    // informations.pixel(x, y) for one pixel
    // informations.pixel(x, y, newpixel) for apply one pixel like when you flip

    // apply 0 value on red by pixel.r = 0;

    // Like this:
    pixel.r = 255 * Math.random();
    pixel.g = 255 * Math.random();
    pixel.b = 255 * Math.random();

});

$(".btn").on("click", function() {
    $("img").restore();
});
Author