Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Check out the <a href="http://xjaphx.wordpress.com/learning/tutorials/" rel="nofollow">Image Processing</a> to apply various effects on Image. It provides various effects to be applied on Image after capturing. </p> <p>Suppose i want to apply contrast effect on image then i will use the below method:</p> <blockquote> <pre><code>public static Bitmap createContrast(Bitmap src, double value) { // image size int width = src.getWidth(); int height = src.getHeight(); // create output bitmap Bitmap bmOut = Bitmap.createBitmap(width, height, src.getConfig()); // color information int A, R, G, B; int pixel; // get contrast value double contrast = Math.pow((100 + value) / 100, 2); // scan through all pixels for(int x = 0; x &lt; width; ++x) { for(int y = 0; y &lt; height; ++y) { // get pixel color pixel = src.getPixel(x, y); A = Color.alpha(pixel); // apply filter contrast for every channel R, G, B R = Color.red(pixel); R = (int)(((((R / 255.0) - 0.5) * contrast) + 0.5) * 255.0); if(R &lt; 0) { R = 0; } else if(R &gt; 255) { R = 255; } G = Color.red(pixel); G = (int)(((((G / 255.0) - 0.5) * contrast) + 0.5) * 255.0); if(G &lt; 0) { G = 0; } else if(G &gt; 255) { G = 255; } B = Color.red(pixel); B = (int)(((((B / 255.0) - 0.5) * contrast) + 0.5) * 255.0); if(B &lt; 0) { B = 0; } else if(B &gt; 255) { B = 255; } // set new pixel color to output bitmap bmOut.setPixel(x, y, Color.argb(A, R, G, B)); } } // return final image return bmOut; } </code></pre> </blockquote> <p>Use above method as:</p> <blockquote> <pre><code> BitMap bmp =BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length); //Here you can define your image and convert it into Bitmap. bmp = createContrast(bm,75); mImageView.setImageBitmap(bmp); </code></pre> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload