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

  • Home
  • SEARCH
  • 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 8618649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:09:33+00:00 2026-06-12T06:09:33+00:00

I have two bitmaps topBitmap and bottomBitmap and I need to blend the two

  • 0

I have two bitmaps topBitmap and bottomBitmap and I need to blend the two bitmaps using color dodge in android. I could not find color dodge in PorterDuffXfermode. Is there any way to do it with ot without the use of a Canvas?

Kindly let me know how to blend two bitmaps using color dodge mode in android.Thanks in advance.

  • 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-12T06:09:35+00:00Added an answer on June 12, 2026 at 6:09 am

    Hi I found this method from somewhere in SO post. This method takes two image and create one image using color dodge

    public Bitmap ColorDodgeBlend(Bitmap source, Bitmap layer) {
                Bitmap base = source.copy(Config.ARGB_8888, true);
                Bitmap blend = layer.copy(Config.ARGB_8888, false);
    
                IntBuffer buffBase = IntBuffer.allocate(base.getWidth() * base.getHeight());
                base.copyPixelsToBuffer(buffBase);
                buffBase.rewind();
    
                IntBuffer buffBlend = IntBuffer.allocate(blend.getWidth() * blend.getHeight());
                blend.copyPixelsToBuffer(buffBlend);
                buffBlend.rewind();
    
                IntBuffer buffOut = IntBuffer.allocate(base.getWidth() * base.getHeight());
                buffOut.rewind();
    
                while (buffOut.position() < buffOut.limit()) {
    
                    int filterInt = buffBlend.get();
                    int srcInt = buffBase.get();
    
                    int redValueFilter = Color.red(filterInt);
                    int greenValueFilter = Color.green(filterInt);
                    int blueValueFilter = Color.blue(filterInt);
    
                    int redValueSrc = Color.red(srcInt);
                    int greenValueSrc = Color.green(srcInt);
                    int blueValueSrc = Color.blue(srcInt);
    
                    int redValueFinal = colordodge(redValueFilter, redValueSrc);
                    int greenValueFinal = colordodge(greenValueFilter, greenValueSrc);
                    int blueValueFinal = colordodge(blueValueFilter, blueValueSrc);
    
    
                    int pixel = Color.argb(255, redValueFinal, greenValueFinal, blueValueFinal);
    
    
                    buffOut.put(pixel);
                }
    
                buffOut.rewind();
    
                base.copyPixelsFromBuffer(buffOut);
                blend.recycle();
    
                return base;
            }
    

    here is the method do get the color dodge for pixel to get the effect

    private int colordodge(int in1, int in2) {
                float image = (float)in2;
                float mask = (float)in1;
                return ((int) ((image == 255) ? image:Math.min(255, (((long)mask << 8 ) / (255 - image)))));
            }
    

    I am trying to create sketch image of original photo, using this method I am able to create cartoonifying the image in color full format but I need in black and white pencil sketch format. If you have any idea then please share it.

    hope this methods are useful to you

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

Sidebar

Related Questions

i have two bitmap images ..and i need to merge the bitmaps with precise
I have two bitmaps that differ only by color. The green one is used
I'm using two bitmaps to draw graphs on them. After drawing I need to
I have two queries that find both the Zip codes, and the States for
I have two bitmaps, and I want to copy pixels from A to B
I have two Bitmaps, named largeBmp and smallBmp. I want to draw smallBmp onto
i have two bitmaps in code (.NET). I'd like to search for the small
I have two problems with an own user control which uses bitmaps: It flickers
I've got a custom view in which I need to draw two bitmaps, one
I have two layers of bitmaps: 1st - some random image 2nd - bitmap

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.