Wolfram Language

Open live version

Make a Hipstamatic Filter

Make a hipstamatic filter and deploy it to the cloud to convert web images.


code

CloudDeploy[ FormFunction[FormObject[{"ImageURL" -> "String"}], ImageEffect[ ColorConvert[ ImageMultiply[ ColorConvert[ ImageAdd[ImageAdjust[Import[#ImageURL], .2], RGBColor[.25, .25, -.1]], "HSB"], Hue[1, .7, 1]], "RGB"], {"PoissonNoise", .5}] &, "JPEG"], Permissions -> "Public"]

how it works

Import pulls an image from the web:

image = Import[ "http://upload.wikimedia.org/wikipedia/commons/thumb/b/b1/\ DauagvpilsKTM-31.jpg/640px-DauagvpilsKTM-31.jpg"]

Increase the contrast slightly:

image2 = ImageAdjust[image, .2]

Boost the red and green channels and tone down the blue:

image3 = ImageAdd[image2, RGBColor[.25, .25, -.1]]

Reduce the saturation by converting the color space to HSB (hue, saturation, brightness) and decreasing the saturation value:

image4 = ImageMultiply[ColorConvert[image3, "HSB"], Hue[1, .7, 1]]

Convert back to RGB and add Poisson noise for graininess:

ImageEffect[ColorConvert[image4, "RGB"], {"PoissonNoise", .5}]

Combine those steps for a hipstamatic filter:

ImageEffect[ ColorConvert[ ImageMultiply[ ColorConvert[ ImageAdd[ImageAdjust[image, .2], RGBColor[.25, .25, -.1]], "HSB"], Hue[1, .7, 1]], "RGB"], {"PoissonNoise", .5}]

To deploy that functionality to the cloud, where anyone can use it, use FormFunction to specify an input field where users can type the URL of an image, and CloudDeploy with Permissions->Public so that it is accessible to everyone.

CloudDeploy[ FormFunction[FormObject[{"ImageURL" -> "String"}], ImageEffect[ ColorConvert[ ImageMultiply[ ColorConvert[ ImageAdd[ImageAdjust[Import[#ImageURL], .2], RGBColor[.25, .25, -.1]], "HSB"], Hue[1, .7, 1]], "RGB"], {"PoissonNoise", .5}] &, "JPEG"], Permissions -> "Public"]