Sunset Lake Software - Comments for "Filtered image is white " http://www.sunsetlakesoftware.com/forum/filtered-image-white Comments for "Filtered image is white " en Your're right, I just tested http://www.sunsetlakesoftware.com/forum/filtered-image-white#comment-1433 <p>Your're right, I just tested it in the simulator. I'll test it on the device tomorrow.</p> <p>Thank you very much for the fast answers. By the way. great framework :)!</p> pubDate Fri, 01 Jun 2012 21:03:21 +0000 dc:creator Rahvin guid false comment 1433 at http://www.sunsetlakesoftware.com Are you trying this in the http://www.sunsetlakesoftware.com/forum/filtered-image-white#comment-1432 <p>Are you trying this in the Simulator or on an actual device? The shorter version of the image capture enables -prepareForImageCapture on the filter it's going to grab an image from, which uses the iOS 5.0 texture caches if available to read the filtered image much faster than the normal route. However, reading from these texture caches is currently broken in the iOS Simulator, where it works just fine on actual devices.</p> <p>The Simulator has some other issues when it comes to this framework, due to the way it has to use software emulation for some of the shader functions, so I tend to do all of my testing on the devices themselves. I suppose I could add a fallback to prevent this on the Simulator, since a number of people have his this issue.</p> pubDate Fri, 01 Jun 2012 20:33:36 +0000 dc:creator Brad Larson guid false comment 1432 at http://www.sunsetlakesoftware.com Thanks for your fast reply http://www.sunsetlakesoftware.com/forum/filtered-image-white#comment-1431 <p>Thanks for your fast reply :).</p> <p>I've tried some different approaches:</p> <p>This works fine... of course:<br /> <div class="geshifilter"><pre class="geshifilter-cocoa"> UIImage *img = [UIImage imageNamed:@&quot;IMG_0100.jpg&quot;]; [imageView setImage:img];</pre></div></p> <p>Using GPUImageView also works fine:<br /> <div class="geshifilter"><pre class="geshifilter-cocoa"> CGRect mainScreenFrame = [[UIScreen mainScreen] applicationFrame]; GPUImageView *primaryView = [[GPUImageView alloc] initWithFrame:mainScreenFrame]; self.view = primaryView; &nbsp; UIImage *inputImage = [UIImage imageNamed:@&quot;IMG_0100.jpg&quot;]; GPUImagePicture *imgSource = [[GPUImagePicture alloc] initWithImage:inputImage]; GPUImageSepiaFilter *filter = [[GPUImageSepiaFilter alloc] init]; [imgSource addTarget:filter]; [filter addTarget:primaryView]; [imgSource processImage];</pre></div></p> <p>Using the 'long' version with UIImageView also works fine:<br /> <div class="geshifilter"><pre class="geshifilter-cocoa"> UIImage *inputImage = [UIImage imageNamed:@&quot;IMG_0100.jpg&quot;]; GPUImagePicture *imgSource = [[GPUImagePicture alloc] initWithImage:inputImage]; GPUImageSepiaFilter *filter = [[GPUImageSepiaFilter alloc] init]; [imgSource addTarget:filter]; [imgSource processImage]; UIImage* outputImage = [filter imageFromCurrentlyProcessedOutput]; [imageView setImage:outputImage];</pre></div></p> <p>The short version does not work, I only get a completely white image:<br /> <div class="geshifilter"><pre class="geshifilter-cocoa"> UIImage *imgSource = [UIImage imageNamed:@&quot;IMG_0100.jpg&quot;]; GPUImageSepiaFilter *filter = [[GPUImageSepiaFilter alloc] init]; UIImage *imgDest = [filter imageByFilteringImage:imgSource]; [imageView setImage:imgDest];</pre></div></p> <p>Is there anything wrong with my 'short' version and UIImageView?</p> pubDate Fri, 01 Jun 2012 20:19:09 +0000 dc:creator Rahvin guid false comment 1431 at http://www.sunsetlakesoftware.com Have you tried saving your http://www.sunsetlakesoftware.com/forum/filtered-image-white#comment-1430 <p>Have you tried saving your UIImage to disk to verify that it's all white, and that there isn't a problem somewhere with your UIImageView? The code you posted above should filter your source image just fine. If you look at the SimpleImageFilter example, I do just this in there for one of the images and that works in all of my tests.</p> pubDate Fri, 01 Jun 2012 19:27:18 +0000 dc:creator Brad Larson guid false comment 1430 at http://www.sunsetlakesoftware.com I've looked through your http://www.sunsetlakesoftware.com/forum/filtered-image-white#comment-1429 <p>I've looked through your samples and finally it worked with using GPUImageView instead of UIImageView. </p> <p>Is there any way to get it to work with UIImageView? How can I assign a flltered UIImage to GPUImageView?</p> pubDate Fri, 01 Jun 2012 19:22:24 +0000 dc:creator Rahvin guid false comment 1429 at http://www.sunsetlakesoftware.com