public boolean is_legal_bilevel()
  {
    final DjVuInfo info = getInfo();

    if(info == null)
    {
      return false;
    }

    final int width  = info.width;
    final int height = info.height;

    if((width <= 0) || (height <= 0))
    {
      return false;
    }

    final JB2Image fgJb2 = getFgJb2();

    if((fgJb2 == null) || (fgJb2.width != width) || (fgJb2.height != height))
    {
      return false;
    }

    return !(hasCodec(bgIWPixmapLock) || hasCodec(fgIWPixmapLock)
    || hasCodec(fgPaletteLock));
  }