private void replaceTransparentPixels(int numLines) {
            List<GifGraphicBlock> graphicBlocks = gifDataStream.graphicBlocks;
            int prevBlockIndex = graphicBlocks.indexOf(this) - 1;

            if (prevBlockIndex >= 0) {
                int maxY = currY + numLines + imageTop;
                int offset = currY * imageWidth;

                // Update right and bottom coordinates
                imageRight = imageLeft + imageWidth;
                imageBottom = imageTop + imageHeight;

                int globalWidth = gifDataStream.logicalScreen.logicalScreenWidth;
                int pixelValue, imageOffset;
                int rgbData[] = forceRGB ? getRgbImageData() : null;

                for (int y = currY + imageTop; y < maxY; y++) {
                    imageOffset = globalWidth * y + imageLeft;
                    for (int x = imageLeft; x < imageRight; x++) {
                        pixelValue = forceRGB ?
                                rgbData[offset] :
                                imageData[offset] & 0xFF;
                        if (pixelValue == transparentColor) {
                            if (forceRGB) {
                                pixelValue = getScreenRGBBuffer() [imageOffset];
                                rgbData[offset] = pixelValue;
                            } else {
                                pixelValue = screenBuffer [imageOffset];
                                imageData[offset] = (byte) pixelValue;
                            }
                        }
                        offset++;
                        imageOffset++;
                    } // for
                } // for

            } // if (prevBlockIndex >= 0)
        }