code: private void readBitmap() {
          // (sub)image position & size.
          header.currentFrame.ix = readShort();
          header.currentFrame.iy = readShort();
          header.currentFrame.iw = readShort();
          header.currentFrame.ih = readShort();
  
          int packed = read();
          // 1 - local color table flag interlace
          boolean lctFlag = (packed & 0x80) != 0;
          int lctSize = (int) Math.pow(2, (packed & 0x07) + 1);
          // 3 - sort flag
          // 4-5 - reserved lctSize = 2 << (packed & 7); // 6-8 - local color
          // table size
          header.currentFrame.interlace = (packed & 0x40) != 0;
          if (lctFlag) {
              // Read table.
              header.currentFrame.lct = readColorTable(lctSize);
          } else {
              // No local color table.
              header.currentFrame.lct = null;
          }
  
          // Save this as the decoding position pointer.
          header.currentFrame.bufferFrameStart = rawData.position();
  
          // False decode pixel data to advance buffer.
          skipImageData();
  
          if (err()) {
              return;
          }
  
          header.frameCount++;
          // Add image to frame.
          header.frames.add(header.currentFrame);
      }
docs: Reads next frame image.