0

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

Ondrej Rafaj
  • 4,070
  • 7
  • 38
  • 61

1 Answers1

2

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.

Brad Larson
  • 168,330
  • 45
  • 388
  • 563
  • are you sure it is available? When you take a look at http://developer.apple.com/library/ios/#documentation/graphicsimaging/reference/CoreImageFilterReference/Reference/reference.html ... the filter is mentioned but not as available on iOS like for example CICrop? Or am I reading the documentation in a wrong way? I have searched for iOS and just 16 filters is marked as supported ... – Ondrej Rafaj Apr 19 '12 at 19:25
  • @Ondrej - Running a query on the device shows it to be available: http://stackoverflow.com/q/8528726/19679 – Brad Larson Apr 19 '12 at 19:27
  • not sure if it will be Apple legal as per my previous edit :( ... nice library btw (GPUImage) ... – Ondrej Rafaj Apr 19 '12 at 19:29
  • 1
    @Ondrej - Every filter returned by that query is fully exposed to developers, so they are all considered public. They were all announced as part of the iOS 5.0 beta release notes, it's just that the official documentation hasn't been updated to match yet. You're safe in using all of those exposed Core Image filters. – Brad Larson Apr 19 '12 at 19:37
  • Thanks a lot, I will actually (probably) start using your filters as they allow me to customise the camera view as well :)) ... thanks again :) (btw, I love smileys) – Ondrej Rafaj Apr 19 '12 at 19:45
  • @Ondrej - If you have any problems, let me know on the GitHub project page. I haven't used the blend modes as thoroughly as many of my other filters, but their color calculation operations should match those of Core Image and the Adobe PDF standard. – Brad Larson Apr 19 '12 at 20:02