change pixel to getPixels android
<p>I have code to change offset bitmap image like this</p>

<pre><code>private void sharpen(Bitmap src, int bitOffset) {

            // get 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;

            // 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);
                    R = Color.red(pixel);
                    G = Color.green(pixel);
                    B = Color.blue(pixel);

                    // round-off color offset
                    R = ((R + (bitOffset / 2)) - ((R + (bitOffset / 2)) % bitOffset) - 1);
                    if(R &lt; 0) { R = 0; }
                    G = ((G + (bitOffset / 2)) - ((G + (bitOffset / 2)) % bitOffset) - 1);
                    if(G &lt; 0) { G = 0; }
                    B = ((B + (bitOffset / 2)) - ((B + (bitOffset / 2)) % bitOffset) - 1);
                    if(B &lt; 0) { B = 0; }

                    // set pixel color to output bitmap
                    bmOut.setPixel(x, y, Color.argb(A, R, G, B));
                    tempBitmap = bmOut;
                    mImageView.setImageBitmap(bmOut);
                    saveToLocal();
                }
            }




    }
</code></pre>

<p>it work , but the process is too long and waste time. The long process cause this code read all pixel in image . When i searching i can use methode getpixels , but i dont know how to use it , can you help me please , thanks :) </p>
