code: public void toWEBP(File src, File dest) {
          try {
              String command = commandDir + (src.getName().endsWith(".gif") ? "/gif2webp " : "/cwebp ") + src.getPath() + " -o " + dest.getPath();
              this.executeCommand(command);
          } catch (Exception e) {
              throw new WebpIOException(e);
          }
      }
docs: Convert normal image to webp file
  
  @param src  nomal image path
  @param dest webp file path