docs: private static BitMatrix extractPureBits(BitMatrix image) throws NotFoundException {
  
      int[] leftTopBlack = image.getTopLeftOnBit();
      int[] rightBottomBlack = image.getBottomRightOnBit();
      if (leftTopBlack == null || rightBottomBlack == null) {
        throw NotFoundException.getNotFoundInstance();
      }
  
      int moduleSize = moduleSize(leftTopBlack, image);
  
      int top = leftTopBlack[1];
      int bottom = rightBottomBlack[1];
      int left = leftTopBlack[0];
      int right = rightBottomBlack[0];
  
      int matrixWidth = (right - left + 1) / moduleSize;
      int matrixHeight = (bottom - top + 1) / moduleSize;
      if (matrixWidth <= 0 || matrixHeight <= 0) {
        throw NotFoundException.getNotFoundInstance();
      }
  
      // Push in the "border" by half the module width so that we start
      // sampling in the middle of the module. Just in case the image is a
      // little off, this will help recover.
      int nudge = moduleSize / 2;
      top += nudge;
      left += nudge;
  
      // Now just read off the bits
      BitMatrix bits = new BitMatrix(matrixWidth, matrixHeight);
      for (int y = 0; y < matrixHeight; y++) {
        int iOffset = top + y * moduleSize;
        for (int x = 0; x < matrixWidth; x++) {
          if (image.get(left + x * moduleSize, iOffset)) {
            bits.set(x, y);
          }
        }
      }
      return bits;
    }