×
Namespaces

Variants
Actions

Instagram Nashvile Filter Recipe

From Nokia Developer Wiki
Jump to: navigation, search

This recipe replicates Instagram's Nashville Filter using Nokia Imaging SDK inbuilt filters.

Article Metadata
Tested with
SDK: Windows Phone 8.0 SDK -->
Devices(s): Nokia Lumia 1020
Article
Last edited: joaocardoso (16 Jul 2014)

Contents

Introduction

The Instagram Nashville filter gives a warm retro fell and adds a soft purple-pink hue. This filter is used in about 2.29% of all photos shared on Instagram (source /filterfakers.com) and the one of the most favorite in Instagram.

The recipe in this article shows how to recreate Nashville by combining some of the 50+ inbuilt filters from the Nokia Imaging SDK. The recipe is loosely based on How to Make Instagram Nashville Effect Using Photoshop (Miracle Machine blog).

The article includes the recipe source code, instructions on how it can be used and tested, performance measurements and a gallery.


Flowers garden recipe.jpg

Source code

The code for creating the effect, the source, renderer and target is described in #How to use the filter and Core concepts (Nokia Developer Library). The fragment below shows only the "recipe-specific" code for adding the filters to the List<IFilter>.


var filters = new List<IFilter>();
//Instagram Filter: Nashville
 
//Adjust colors
Curve curve_red = new Curve(CurveInterpolation.Linear);
curve_red.SetPoint(170, 188);
curve_red.SetPoint(101, 111);
curve_red.SetPoint(57, 19);
 
Curve curve_green = new Curve(CurveInterpolation.Linear);
curve_green.SetPoint(255, 229);
curve_green.SetPoint(192, 185);
curve_green.SetPoint(116, 130);
curve_green.SetPoint(71, 86);
curve_green.SetPoint(19, 3);
 
Curve curve_blue = new Curve(CurveInterpolation.Linear);
curve_blue.SetPoint(255, 208);
curve_blue.SetPoint(0, 64);
 
filters.Add(new CurvesFilter(curve_red, curve_green, curve_blue));

How to use the filter

This recipe uses only filters based on IFilter. These are combined by simply adding them to an IFilter list, which is then passed to a FilterEffect along with the source. The code fragment below shows the general strategy (this is explained in more detail in Nokia Developer SDK - Core concepts).

var filters = new List<IFilter>();
//The recipe filters are added here
...
...
 
using (var source = new StreamImageSource(stream))
using (var filterEffect = new FilterEffect(source) { Filters = filters })
using (var renderer = new WriteableBitmapRenderer(filterEffect, writeableBitmap))
{
await renderer.RenderAsync();
}


Testing the filter

The easiest way to test the recipes is to add them to the Test Apps for Viewing Custom Filters (Nokia Imaging SDK) (a fork of the Real Time Filter Demo). Simply to add the filter source above to both RealtimeFilterDemo and StaticFilterViewer test apps in their respective switch statements. You may also need to add the line:

using Windows.UI;

Gallery

Summary

This is a fairly accurate reproduction of the Instagram Nashville filter using Nokia Imaging SDK recipes.
This page was last modified on 16 July 2014, at 17:15.
327 page views in the last 30 days.
×