protected void getImagePixels() {
        int w = image.getWidth();
        int h = image.getHeight();
        if ((w != width) || (h != height)) {
            // create new image with right size/format
            Bitmap temp = Bitmap.createBitmap(width, height, Config.RGB_565);
            Canvas g = new Canvas(temp);
            g.drawBitmap(image, 0, 0, new Paint());
            image = temp;
        }
        int[] data = getImageData(image);
        pixels = new byte[data.length * 3];
        for (int i = 0; i < data.length; i++) {
            int td = data[i];
            int tind = i * 3;
            pixels[tind++] = (byte) ((td >> 0) & 0xFF);
            pixels[tind++] = (byte) ((td >> 8) & 0xFF);
            pixels[tind] = (byte) ((td >> 16) & 0xFF);
        }
    }
Extracts image pixels into byte array "pixels"
subs/gif-revert/src/main/java/com/engineer/gif/revert/lib/AnimatedGifEncoder.java