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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:57:59+00:00 2026-06-11T15:57:59+00:00

Related topic (without solution yet): Access to raw data in ARGB_8888 Android Bitmap In

  • 0

Related topic (without solution yet): Access to raw data in ARGB_8888 Android Bitmap

In short: when using copyPixelFromBuffer and copyPixelsToBuffer, Android already applied the Alpha channel on the RGB channels.

I need to convert it into original ARGB value and vice-versa. I don’t know how does Android apply it. Can you please tell me the formula?

  • 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-11T15:58:01+00:00Added an answer on June 11, 2026 at 3:58 pm

    Android stores Bitmap data in alpha premultiplied form. In other words, the alpha value is not applied when the data is copied, it has been applied all the time.

    To convert into premultiplied form, multiply the color components with the normalized alpha value, like this:

    redPremultiplied   = red   * normalizedAlpha
    greenPremultiplied = green * normalizedAlpha
    bluePremultiplied  = blue  * normalizedAlpha
    alphaPremultiplied = alpha
    

    where

    red             = <value between 0 and 255>
    green           = <value between 0 and 255>
    blue            = <value between 0 and 255>
    alpha           = <value between 0 and 255>
    normalizedAlpha = alpha / 255
    

    To convert from premultiplied alpha to canonical form, divide the premultiplied components with the normalized alpha:

    red   = redPremultiplied   / normalizedAlpha
    green = greenPremultiplied / normalizedAlpha
    blue  = bluePremultiplied  / normalizedAlpha
    alpha = alphaPremultiplied
    

    but be sure to watch out for normalizedAlpha = 0! You should note though that the data handled by Bitmap.copyPixelsToBuffer() and Bitmap.copyPixelsFromBuffer()in theory can be in any format. It is safer to use Bitmap.getPixels() and Bitmap.setPixels(), because the API makes guarantees about the format of the data handled by those functions. In particular, you don’t have to worry about premultiplying and un-premultiplying the alpha, because those functions handle that for you.

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

Sidebar

Related Questions

My question is related to this topic How to copy and paste code without
All my questions in this topic related to asp.net 2.0 While working on some
The title is my question. I already found a topic related to this here
I need topic ideas related to AI on which I will base my thesis.
On the Freebase website topic pages they have a section called Related Topics. So
As I summarized at topic I want to show the DIV related with clicked
I have downloaded some files from the internet related to a particular topic. Now
I read all the questions related to this topic, and they all give reasons
Related Topic: How to write a:hover in inline CSS? I need to create an
I have searched for related topic, but still can't solve the problem... use threads;

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.