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 8217243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:23:47+00:00 2026-06-07T12:23:47+00:00

What is possible solution to banded images in Android Activity or in OpenGl. Look

  • 0

What is possible solution to banded images in Android Activity or in OpenGl.

Look at the answer below.

Hope it Helps

  • 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-07T12:23:49+00:00Added an answer on June 7, 2026 at 12:23 pm

    Color Banding Solved ooooooooooyyyyyyyeaaaaaaaaaa

    I solved color banding in two phases

    1) * when we use the BitmapFactory to decode resources it decodes the resource in RGB565 which shows color banding, instead of using ARGB_8888, so i used BitmapFactory.Options for setting the decode options to ARGB_8888

    second problem was whenever i scaled the bitmap it again got banded

    2) This was the tough part and took a lot of searching and finally worked
    * the method Bitmap.createScaledBitmap for scaling bitmaps also reduced the images to RGB565 format after scaling i got banded images(the old method for solving this was using at least one transparent pixel in a png but no other format like jpg or bmp worked)so here i created a method CreateScaledBitmap to scale the bitmap with the original bitmaps configurations in the resulting scale bitmap(actually i copied the method from a post by logicnet.dk and translated in java)

        BitmapFactory.Options myOptions = new BitmapFactory.Options();
        myOptions.inDither = true;
        myOptions.inScaled = false;
        myOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;//important
        //myOptions.inDither = false;
        myOptions.inPurgeable = true;
        Bitmap tempImage =  
        BitmapFactory.decodeResource(getResources(),R.drawable.defaultart, myOptions);//important
    
        //this is important part new scale method created by someone else
        tempImage = CreateScaledBitmap(tempImage,300,300,false);
    
        ImageView v = (ImageView)findViewById(R.id.imageView1);
        v.setImageBitmap(tempImage);
    

    // the function

    public static Bitmap CreateScaledBitmap(Bitmap src, int dstWidth, int dstHeight, boolean filter)
    {
        Matrix m = new Matrix();
        m.setScale(dstWidth  / (float)src.getWidth(), dstHeight / (float)src.getHeight());
        Bitmap result = Bitmap.createBitmap(dstWidth, dstHeight, src.getConfig());
        Canvas canvas = new Canvas(result);
        //using (var canvas = new Canvas(result))
        {
            Paint paint = new Paint();
            paint.setFilterBitmap(filter);
            canvas.drawBitmap(src, m, paint);
        }
        return result;
    
    }
    

    Please correct me if i am wrong.
    Also comment if it worked for you.

    I am so happy i solved it, Hope it works for you All.

    For OpenGl you simply bind the bitmap created after applying upper functions

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

Sidebar

Related Questions

I was trying to look out for a possible solution and am yet to
For a possible solution using Active Directory and Exchange see my post below. We
Please note the Edit below for a lot more information, and a possible solution
One possible solution could be simple HTTP get or post request, but that wouldn't
(Edit: put possible solution at end) I'm a C/C++ programmer who is learning Objective
I'm figuring out a possible solution for a dynamic crossfade of HTML elements. The
I'm considering using this jquery utility as a possible solution, but I want to
I've read about postion:absolute problems and tried almost every possible solution. Including positioning divs
is this solution possible in asp.net dragging picturebox inside winform on runtime i just
Possible Duplicate: Java: recommended solution for deep cloning/copying an instance I have an object

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.