Real-time RED Filter using Nokia Imaging SDK
Note: This is an entry in the Nokia Original Imaging Effect Wiki Challenge 2014Q2
In this article, you will learn how to implement real-time red filter using Nokia Imaging SDK.
Windows Phone 8
For better understanding, it is recommended that you read the following articles before implementing this filter:
- Nokia Imaging SDK
- Core concepts
- Adding libraries to the project
- Real-time Filter Demo for Windows Phone 8.0
Quick Installation Guide
- Download this ZIP file.
- Copy the RealtimeRedFilterDemoWP folder to C:\Users\YOUR_USER_NAME_HERE\Documents\Visual Studio 2013\Projects
- Open the project in Visual Studio from FILE -> Open Project... .
- Make sure your WP 8.1 device is connected to your PC/laptop and then press F5.
- The WP 8.1 app REAL-TIME RED FILTER DEMO will install and launch.
This filter is implemented by bitwise-AND-ing every source pixel value with 0xffff0000 i.e. alpha and red components are preserved and green and blue components are destroyed.
Note: This is an entry in the Nokia Original Imaging Effect Wiki Challenge 2014Q2. This application demonstrates the implementation of real-time red filter using Nokia Imaging SDK.
* Developer: Manojit Ghosh
public class CustomEffect : CustomEffectBase
public CustomEffect(IImageProvider source) : base(source)
protected override void OnProcess(PixelRegion sourcePixelRegion, PixelRegion targetPixelRegion)
var sourcePixels = sourcePixelRegion.ImagePixels;
var targetPixels = targetPixelRegion.ImagePixels;
sourcePixelRegion.ForEachRow((index, width, position) =>
for (int x = 0; x < width; ++x, ++index)
// the only supported color format is ColorFormat.Bgra8888
uint pixel = sourcePixels[index]&0xffff0000; //Green & Blue components are removed using Bitwise-AND operator
targetPixels[index] = pixel;
Implementation of Similar Filters Using the Same Strategy
In this article, I explained how to implement real-time red filter, however, it is not hard to guess that this same strategy of bitwise-AND-ing can be used to implement similar filters. For instance, to implement real-time blue filter just use 0xff0000ff instead of 0xffff0000 .
More information about RGBA color space can be found here.
I hope you have enjoyed the article. If you want to contribute to this article you are welcome. If you have any questions don't hesitate to ask them in the comments or in Twitter.