title: GPUImage Grayscale and contarst filter generating memory warning
body: <p>I am creating an app that convert image to binary image. For that i am using GPUimage framework.
  First it will convert it to grayscale than change contarst and than conevrt it to Binarize image.</p>
  
  <p>When i use grayscale and contrast filter it will generate memory warning and some time if i try to convert multiple image (lets say 10) at one by one app crashes.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>- (UIImage *) doBinarize:(UIImage *)sourceImage
      {
          UIImage * grayScaledImg = [self grayImage:sourceImage];
          grayScaledImg = [self contrastImage:grayScaledImg];
  
          GPUImagePicture *imageSource = [[GPUImagePicture alloc] initWithImage:grayScaledImg];
          GPUImageAdaptiveThresholdFilter *stillImageFilter = [[GPUImageAdaptiveThresholdFilter alloc] init];
          stillImageFilter.blurRadiusInPixels = 8.0;
  
          [imageSource addTarget:stillImageFilter];
          [imageSource processImage];
          UIImage *retImage = [stillImageFilter imageByFilteringImage:grayScaledImg];
  
          UIImage * aretImage = [self sharpenImage:retImage];
  
          [imageSource removeAllTargets];
  
          return aretImage;
      }
  
      - (UIImage *) grayImage :(UIImage *)inputImage
      {
          GPUImageGrayscaleFilter *selectedFilter = [[GPUImageGrayscaleFilter alloc] init];
          UIImage *filteredImage = [selectedFilter imageByFilteringImage:inputImage];
          return filteredImage;
      }
  
      - (UIImage *) sharpenImage :(UIImage *)inputImage
      {
          GPUImageSharpenFilter *sharpenFilter = [[GPUImageSharpenFilter alloc] init];
          [sharpenFilter setSharpness:10];
          UIImage *quickFilteredImage = [sharpenFilter imageByFilteringImage: inputImage];
          return quickFilteredImage;
      }
  
      - (UIImage *) contrastImage :(UIImage *)inputImage
      {
          GPUImageContrastFilter *contrastfilter =[[GPUImageContrastFilter alloc]init];
          [contrastfilter setContrast:3];
          UIImage *ima= [contrastfilter imageByFilteringImage:inputImage];
          return ima;
      }
  </code></pre>
  
  <p>If i close the code of gray and contrast memory warning gone so problem is in that code.</p>