How to replicate CIDarkenBlendMode on iOS5 - ios

Does anyone know how to replicate CIDarkenBlendMode (Core Image filter) on iOS? I need to simulate an old paper by combining two images ...

Why do you need to replicate CIDarkenBlendMode? It's a supported filter in Core Image as of iOS 5.0, so you can use it directly.
If you don't want to use Core Image for this, my GPUImage framework also has a darken blend mode in its GPUImageDarkenBlendFilter.

Related

How do i add this 'Scanned Effect' on my CIImage Swift

The first image is the image using my phone. The one under it is the Photoshopped version of the first one. I adjusted some levels on that image. Any idea how I can do this in Swift?
Welcome!
Since iOS 13, Core Image provides a new CIDocumentEnhancer filter that basically does what Notes does when scanning a document.
If you want more control, you can probably also use a simple CIColorControls filter for adjusting contrast and brightness.

Adding filters/effects to images in ios 9

Are there any easy or open source tools or Apple commands to add filters to an ios 9 app I am building?
The app uses the image picker.
Use CIFilter implemented in Core Image.
I have once used GPUImage. You can use it to add filters and other effects to images, live camera video, and movies.You can read the documentation its very easy to implement.

Apply filter to MPMoviePlayer thumbnails without lag

I am able to generate a CGImage from a thumbnail in MPMoviePlayer. What I want to do is apply a filter on the image and show it on the device as fast as possible (probably in a UIImageView).
The caveat here is that I need to apply the filter to every frame of the video so the user sees filtered images in a video stream, with no lag.
At the moment I get the thumbnail, apply my filter, and set my UIImageView.image to this filtered image. The filter works fine, the image shows up, but the app really lags. Is there any way to speed this up?
I've also tried using a CAdisplaylink as this has helped me speed up multiple UIImages flying around on screen at once, but it doesn't do anything in this instance. Any help would be appreciated.
Thank you.
Use Brad Larsons GPUImage framework. In short... it's brilliant.
Here's an overview:
The GPUImage framework is a BSD-licensed iOS library that lets you apply GPU-accelerated filters and other effects to images, live camera video, and movies. In comparison to Core Image (part of iOS 5.0), GPUImage allows you to write your own custom filters, supports deployment to iOS 4.0, and has a simpler interface. However, it currently lacks some of the more advanced features of Core Image, such as facial detection.
For massively parallel operations like processing images or live video frames, GPUs have some significant performance advantages over CPUs. On an iPhone 4, a simple image filter can be over 100 times faster to perform on the GPU than an equivalent CPU-based filter.
Here's the link https://github.com/BradLarson/GPUImage containing the page to the git repository, details and sample project where live processing is done with many filters.

To Convert Image to Cartoon in ios

Is there any filters available in ios to convert a image to cartoonistic image like exactly in the above picture?
For a much faster solution than ImageMagick, you could use the GPUImageToonFilter from my GPUImage framework:
It combines Sobel edge detection with posterization of the image to give a good cartoon-like feel. As implemented in this framework, it's fast enough to run on realtime video from the iPhone's camera, and is probably at least an order of magnitude faster than something similar in ImageMagick. My framework's also a little easier to integrate with an iOS project than ImageMagick.
If you want more of an abstract look to the image, the GPUImageKuwaharaFilter converts images into an oil painting style, as I show in this answer.
Try to use imagemagick for iOS http://www.imagemagick.org/download/iOS/
Of course you need some serval hours how to use imagemagick for iOS.
But then you should also look at: http://www.fmwconcepts.com/imagemagick/cartoon/index.php
and maybe also on:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=11140&start=0&st=0&sk=t&sd=a
This Core Image filter section in the iOS dev library, possibly combined with the script referenced by Jonas and a little luck, might get you where you're going. Not sure, having never used either of these technologies.

Invert all colors from within the application

Is it possible to replicate the white on black feature that the iphone has from within an application.
I am trying to set up a toggle and when turned on the application will invert all of it's colors. Essentially creating a 'night time mode'
You could use Core Image. There is a filter called CIColorInvert which inverts the colors in an image. You can find out more about Core Image filters here.
If you want some help with Core Image, you could check out this tutorial by Ray Wenderlich: Beginning Core Image in iOS 5 Tutorial
Hope this helps!

Resources