thumbor/thumbor — pull request #386 by clifff (2014-11-17 22:06:25+00:00)
Title: New filters: Colorize and Saturation

This PR adds two new filters so that Vox Media can replicate some functionality we were previously doing in ImageMagick with Thumbor. Here is some wiki ready info on each:

------

## Colorize

### Usage

colorize(redPercentage, greenPercentage, bluePercentage, fillColor)

### Description

Blends the fill color with the image pixels.

### Arguments

redPercentage - The percentage of the fill color to blend per pixel. Excepts an integer. Can range from -100 to 100.
greenPercentage - The percentage of the fill color to blend per pixel. Excepts an integer. Can range from -100 to 100.
bluePercentage - The percentage of the fill color to blend per pixel. Excepts an integer. Can range from -100 to 100.
fillColor - A 6 digit hex value for the fill color.

### Example

Without filter:
![colorize_before](https://cloud.githubusercontent.com/assets/51312/5078393/6cf7e7ee-6e7a-11e4-9231-8ae1d349a98d.png)

With filter:
![colorize_after](https://cloud.githubusercontent.com/assets/51312/5078396/7403adf2-6e7a-11e4-97ff-0f948b50e92b.png)

http://thumbor-server/filters:colorize(35,40,50,79A8B2)/some/image.jpg

-------

## Saturation

### Usage

saturation(percentage)

### Description

Scales the color saturation of an image based on the given percentage.

### Arguments

percentage - Expects a decimal percentage, probably between 0.0 and 2.0. A value of 0.0 yields a grayscale image, 1.0 the original image, and 2.0 an image twice as saturated.

### Example

Without filter
![before_saturation](https://cloud.githubusercontent.com/assets/51312/5078523/70ced444-6e7b-11e4-9dea-40a3a7b02f16.jpg)

With filter
![after_saturation](https://cloud.githubusercontent.com/assets/51312/5078527/76e561cc-6e7b-11e4-90fe-e12e2994299b.jpg)

http://thumbor-server/filters:saturation(0.20)/some/image.jpg