title: Color correction on android
body: <p>i am new in android programming. Now i am doing a color correction program using java for android platform.</p>
  
  <p>In the program, i should be able to select a point on the bitmap and tell the program that it is actually white color, and the program will re-adjust all the pixels of that bitmap so that all the colors of that bitmap will be correct. </p>
  
  <p>Can anyone tell me how can i do this? I am already able to retrieve a point from a bitmap now and calculate its RGB, but i got no idea how i can carry on. Please show me some examples or articles that i can read up on. </p>
  
  <p>Thank you so much for your precious time. Hope to hear from you soon!</p>
  
  <hr>
  
  <p>Resulting photo :
  <a href="http://www.flickr.com/photos/92325795@N02/8392038944/in/photostream" rel="nofollow">http://www.flickr.com/photos/92325795@N02/8392038944/in/photostream</a></p>
  
  <p>My photo is being updated and despite of the quality/noise/color, there are the weird colors here and there. Anyone have any idea what i should do to remove it? Or even better improve on the method i am using? Heres the code:</p>
  
  <p>The input is the bitmap to edit, inColor is the color of the nose in the photo to be edited, reqcolor is the color of my nose in the sample/optimum photo.</p>
  
  <pre><code>    public Bitmap shiftRGB(Bitmap input, int inColor, int reqColor){
  
          int deltaR = Color.red(reqColor) - Color.red(inColor);
          int deltaG = Color.green(reqColor) - Color.green(inColor);
          int deltaB = Color.blue(reqColor) - Color.blue(inColor);
  
          //--how many pixels ? --
          int w = input.getWidth();
          int h = input.getHeight();
  
  
          //-- change em all! --
          for (int i = 0 ; i &lt; w; i++){
              for (int  j = 0 ; j &lt; h ; j++ ){
                  int pixColor = input.getPixel(i,j);
  
                  //-- colors now ? --
                  int inR = Color.red(pixColor);
                  int inG = Color.green(pixColor);
                  int inB = Color.blue(pixColor);
  
                  if(inR &gt; 255){ inR = 255;}
                  if(inG &gt; 255){ inG = 255;}
                  if(inB &gt; 255){ inB = 255;}
                  if(inR &lt; 0){ inR = 0;}
                  if(inG &lt; 0){ inG = 0;}
                  if(inB &lt; 0){ inB = 0;}
  
                  //-- colors then --
                  input.setPixel(i,j,Color.argb(255,inR + deltaR,inG + deltaG,inB           + deltaB));
              }
          }
  
          return input;
   }
  </code></pre>
  
  <p>Thank you so much for help me! I cant express my gratitude further than saying another thank you in advance!</p>