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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:04:00+00:00 2026-06-14T05:04:00+00:00

I’m writing a gauss filter for android. According to the GaussFilter example of this

  • 0

I’m writing a gauss filter for android.

According to the GaussFilter example of this tutorial: http://www.jhlabs.com/ip/blurring.html I’m editing my ALPHA value like this

alpha += f * ((pixelValue >> 24) & 0xff);

According to this Thread :
Using logical bitshift for RGB values

 (pixelValue >>24 & 0xff);

is not equivalent to

Color.alpha(pixelValue);

As far as I know, the alpha channel is optional in RGB.
So it depends on the depth how I read and edit the alpha and rgb vlaues.

There are lots of combinations for different color depths, for example:

  • 4 bit no alpha
  • 4 bit + 4 bit alpha
  • 24 bit including alpha (?)
  • Macintosh offers 24 bit plus (or including?) 8 bit alpha

Since I don’t know which type of image the user wants to process, I have to catch all the combinations. I’d just use Color.Red(value), Color.Green(value) … but I’m not sure whether this will be too slow in the end? I could convert every input into a 24 bit Bitmap before processing, but this would take too long.

Any help is appreciated, thank you.

  • 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-14T05:04:01+00:00Added an answer on June 14, 2026 at 5:04 am
    1. First of all, if you are worried about performance, you should implement it and measure.

    2. If you want fastest possible implementation, you pretty much have to specialize it for each pixel format. But most likely you only need to handle only one, see below.

    3. On the other hand, assuming you load your bitmap as Bitmap class instance, there are just 4 possible pixel formats, and ARGB_8888 is probably the only one you should care about (perhaps RGB_565 too, but I don’t expect nice blur effect with such a small bits-per-pixel value). Actually, bitmaps are loaded with ARGB_8888 configuration by default, according to BitmapFactory.Options documentation. In other words – using standard Android’s bitmap handling API you do not need to do any conversion, it is done for you – just specify the format you need.

    4. In fact (pixelValue >>24 & 0xff); and Color.alpha(pixelValue); are equivalent for ARGB_8888 pixel format, it can however be done better.

    Using logical shift operator (as opposed to >>, arithmetic shift) you do not need & 0xFF operation at all, as bits 31..8 are always 0. See how Color.alpha() is implemented:

    public static int alpha(int color) {
        return color >>> 24;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.