title: Mapping CoreGraphics Blend Modes to Porter-Duff
body: <p>I have an iPhone app that does image manipulation via blending two <code>UIImage</code> objects via CoreGraphics, specifically <code>CGContextSetBlendMode</code>. I am currently researching porting it to Android. I've gone through the process of combining to <code>Bitmap</code> objects on Android using PorterDuff modes. However, I want much more complicate compositing. For example, I'm using <code>kCGBlendModeHardLight</code> for many blends:</p>
  
  <blockquote>
    <p>Either multiplies or screens colors,
    depending on the source image sample
    color. If the source image sample
    color is lighter than 50% gray, the
    background is lightened, similar to
    screening. If the source image sample
    color is darker than 50% gray, the
    background is darkened, similar to
    multiplying. If the source image
    sample color is equal to 50% gray, the
    source image is not changed. Image
    samples that are equal to pure black
    or pure white result in pure black or
    white. The overall effect is similar
    to what you’d achieve by shining a
    harsh spotlight on the source image.
    Use this to add highlights to a scene.</p>
  </blockquote>
  
  <p>But don't know of anyway (if it's even possible) to emulate this via Porter-Duff. Does Android not support better Image Manipulation algorithms out of the box? Is it possible to use Porter-Duff in some way to emulate more advanced blend modes?</p>