Search code examples
iosactionscript-3image-processingairinstagram-api

Instagram Filters RGBA Values


I need to add image filters to an iOS app that is being developed using Adobe Air.

To be more specific, i need to apply the following filters (or similar):

  1. Nashville
  2. Hemingway
  3. Jarques
  4. Cross Process
  5. Hazy Days

You can use this page as a reference http://techslides.com/demos/canvas/instagram.html

I know how to apply filters to a BitmapData on AS3, but i need the RGBA values of the above filters, does anyone knows them or knows how to obtain them?

I need something like the following values:

    private static const NASHVILLE_FILTER_MATRIX: Array = [
        1, 0, 0, 0, 0, //R
        0, 0, 0, 0, 0, //G
        0, 0, 0, 0, 0, //B
        0, 0, 0, 1, 0  //A
    ];

Thank you for any help you can give me.


Solution

  • I recommend you to to check this framework GPUImage There is an example here

    You can create filters like:

      // creating GPU Image
      _gpuImg = new GPUImage();
      _gpuImg.init(context3D, antiAlias, false, stageW, stageH, streamW, streamH);
    
      // saving all filters
      _imageProcessors = new Vector.<IGPUImageProcessor>();
    
      // setup filters
      var _gpuSepia:GPUImageSepia = new GPUImageSepia();
      var _gpuGauss:GPUImageGaussianBlur = new GPUImageGaussianBlur(1.0, 4);
      var _gpuGray:GPUImageGrayscale = new GPUImageGrayscale();
    
      // Bloom Filter            
      var bloomEffect:GPUImageBloomEffect = new GPUImageBloomEffect(GPUImageBloomEffect.PRESET_DESATURATED, 4);
      bloomEffect.initPreset(GPUImageBloomEffect.PRESET_SATURATED);
      // TiltShift
      var tiltShift:GPUImageTiltShiftEffect = new GPUImageTiltShiftEffect(2, 0.4, 0.6, 0.2);
    
      // adding filter to image processor
      _imageProcessors.push(bloomEffect);
    
      // adding processor to the respective GPU Image
      _gpuImg.addProcessor(_imageProcessors[0]);