Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:45:32+00:00 2026-06-05T22:45:32+00:00

I am currently porting an application from iOS into Android and I have ran

  • 0

I am currently porting an application from iOS into Android and I have ran into some difficulties when it comes to image processing.

I have a filter class that is comprised of ImageOverlays and ColorOverlays which are applied in a specific order to a given base Bitmap. Each ColorOverlays has an RGB color value, a BlendModeId, and an alpha value. Each ImageOverlay has an image Bitmap, a BlendModeId, and an alpha/intensity value.

My main problem is that I need to support the following blend modes taken from iOS:

  1. CGBlendModeNormal
  2. CGBlendModeMultiply
  3. CGBlendModeScreen
  4. CGBlendModeOverlay
  5. CGBlendModeDarken
  6. CGBlendModeLighten
  7. CGBlendModeColorDodge

Some of these have corresponding PorterDuff.Mode types in Android while others do not. What’s worse, some of the modes that do exist were introduced in recent versions of Android and I need to run on API level 8.

Trying to build the modes from scratch is extremely inefficient.

Additionally, even with the modes that do exist in API8, I was unable to find methods that blend 2 images but that allow you to specify the intensity of the mask (the alpha value from ImageOverlay). Similarly with ColorOverlays.

The iOS functions I am trying to replicate in Android are

CGContextSetBlendMode(...)
CGContextSetFillColorWithColor(...)
CGContextFillRect(...) - This one is easy
CGContextSetAlpha(...)

I have started looking at small third party libraries that support these blend modes and alpha operations. The most promising one was poelocesar’s lib-magick which is supposedly a port of ImageMagick.

While lib-magick did offer most of the desired blend modes (called CompositeOperator) I was unable to find a way to set intensity values or to do a color fill with a blend mode.

I’m sure somebody has had this problem before. Any help would be appreciated. BTW, Project specifications forbid me from going into OpenGLES.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:45:33+00:00Added an answer on June 5, 2026 at 10:45 pm

    Even though I helped you via e-mail, I thought I’d post to your question too in case someone wanted some more explanation 🙂

    2.2 is API level 8, which supports the “libjnigraphics” library in the
    NDK, which gives you access to the pixel buffer for bitmap objects.
    You can do these blends manually – they are pretty simple math
    calculations and can be done really quickly.

    Check out this site for Android JNI bitmap information.

    It’s really simple, just create a JNI method blend() with any
    parameters you need (either the color values or possibly another bitmap object to blend together), lock the pixel buffer for that bitmap, do the
    calculation needed, and unlock the bitmap. Link

    Care needs to be taken on the format of the bitmap in memory, though,
    as the shifting/calculation for 565 will be different than 8888. Keep that in mind if it doesn’t look exactly correct!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently integrating some new classes into an existing application. I have a JDialog
I'm currently porting an application from Fortran to C and need to output some
I'm porting my application from 32 bit to 64 bit. Currently, the code compiles
I'm currently porting my GAE app to Python 2.7 and have come across some
I'm currently porting an application from iPhone to Windows Phone. The behaviour of buttons
I'm currently porting a pretty basic gallery application from PHP to Go. This application
Currently I am porting client side of my application from Active X to Dojo.
i am coming from an android developer pov. I do have some query about
I'm currently porting my jruby/java2d Graph Drawing/Layouting application to macruby/cocoa. Therefore I need to
I'm currently porting an ObjC cocos2d game to cocos2d-x, but I'm encountering some problems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.