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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:59:52+00:00 2026-05-27T06:59:52+00:00

I apply sepia effect on image but when I click on button to apply

  • 0

I apply sepia effect on image but when I click on button to apply its done but after 90 sec .

public static Bitmap effect(Bitmap src, int depth, double red, double green, double blue) 
{

        int width = src.getWidth();
        int height = src.getHeight();
        Bitmap bmOut = Bitmap.createBitmap(width, height, src.getConfig());
        final double GS_RED = 0.3;
        final double GS_GREEN = 0.59;
        final double GS_BLUE = 0.11;

        int A, R, G, B;
        int pixel;


        for(int x = 0; x < width; ++x) {
            for(int y = 0; y < height; ++y) {

                pixel = src.getPixel(x, y);

                A = Color.alpha(pixel);             
                R = Color.red(pixel);
                G = Color.green(pixel);
                B = Color.blue(pixel);

                B = G = R = (int)(GS_RED * R + GS_GREEN * G + GS_BLUE * B);

                R += (depth * red);
                if(R > 255) { R = 255; }

                G += (depth * green);
                if(G > 255) { G = 255; }

                B += (depth * blue);
                if(B > 255) { B = 255; }
                bmOut.setPixel(x, y, Color.argb(A, R, G, B));
                   }}

    return bmOut;
}
  • 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-05-27T06:59:52+00:00Added an answer on May 27, 2026 at 6:59 am

    Oh, it appears that you are using the sample code on my blog: http://xjaphx.wordpress.com/2011/06/21/image-processing-photography-sepia-toning-effect/
    The article means to demonstrate the how to implement the algorithm, so it certainly doesn’t mention anything else.

    As for performance problem, I suggest:

    1. If you develop under Application Level (Java code..), use getPixels() setPixels() and manipulate the two-dimensional array. Well, in this sepia-toning, it might be up to only 5-10 seconds on emulator, on real device it might be 3 seconds.

    2. It’s preferable to do all image processing stuffs on NDK (like creating image processing library..), it will process much faster.

    Anyway, have fun!

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

Sidebar

Related Questions

I am trying to apply effect (sepia, brightness, bloom and other image effects if
I am trying to apply a background image hover effect on each row in
How do I apply a sepia tone to a photo with Cocoa Touch on
if i try to apply multiple background images, works great: .selector{ background-image: url(image1.png), url(image2.pnng);
After spending a couple months studying DDD methodology, I've now began to apply these
I apply: $(.newContentLink).click(function() { $(#test).append(1); }); On this: <span id=contents> <input class=newContentLink type=submit style=width:
To apply left to right scale toa button i have used the following code.
Is it possible to apply / create a YUI Button by using an element's
How can we apply effects like a sepia filter to our camera images?
I apply a filter to Dataview and after that I need to get the

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.