BradLarson/GPUImage — Issue #18: Capturing UIImage with GPUImageSketchFilter produces black and white image
Author: paulpilone
Created: 2012-03-06 05:18:41+00:00
State: open

Hey Brad - I'm trying out a few of your filters and I'm having some trouble with the GPUImageSketchFilter. I've modified the SimpleImageFilter example and replaced the default sepia filter with a sketch filter. I immediately capture a UIImage using:

UIImage *image = [sketchFilter imageFromCurrentlyProcessedOutput];

and writing it to the photos library using:

ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library writeImageToSavedPhotosAlbum:[image CGImage] metadata:nil completionBlock:nil];

It's a fairly basic example but I noticed that the image written is simply a black and white image. The preview of the image in the app properly has the "sketch" effect applied to it. I noticed this issue in a different app I was working on and wanted a simple example to demonstrate it.

Is saving an image this way not intended behavior? Should I be doing something different here to write out the filtered image?