ユーティリティのコンパイル
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
事前コンパイルされたユーティリティがニーズに合わない場合は、WebP ユーティリティを自分でビルドできます。
Visual C++ を使用した Windows でのコンパイル
ダウンロード リストから libwebp-1.6.0.tar.gz
をダウンロードし、その内容を抽出します。
libwebp-1.6.0
ディレクトリから次のコマンドを実行します。
nmake /f Makefile.vc CFG=release-static RTLIBCFG=static OBJDIR=output
その他のオプションを表示するには、次のコマンドを実行します。
nmake /f Makefile.vc
ディレクトリ output\release-static\x86\bin
または output\release-static\x64\bin
には、ターゲット プラットフォームに応じてツール cwebp.exe
と dwebp.exe
が含まれます。ディレクトリ output\release-static\(x86|x64)\lib
には、libwebp
静的ライブラリが含まれます。
Linux
JPEG、PNG、TIFF、GIF、WebP の画像形式を変換するために必要な libjpeg
、libpng
、libtiff
、libgif
パッケージをインストールします。
パッケージ管理は Linux ディストリビューションによって異なります。Ubuntu と Debian では、次のコマンドで必要なパッケージがインストールされます。
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev
インストールを完了します(下記を参照)。
macOS
MacPorts は、依存関係を満たす便利な方法です。MacPorts がすでにインストールされている場合は、ステップ 3 に直接進みます。それ以外の場合は、次の手順を行います。
MacPorts の ダウンロード サイトから、お使いの macOS バージョン用の MacPorts をダウンロードします。MacPorts には Xcode のインストールが必要です。
MacPorts の手順に沿って MacPorts をインストールします。
MacPorts を更新します。
sudo port selfupdate
JPEG、PNG、TIFF、GIF の依存関係をインストールします。
sudo port install jpeg libpng tiff giflib
インストールを完了します(下記を参照)。
Cygwin
Cygwin のウェブページから setup.exe をダウンロードします。
setup.exe を実行し、インストールを進めます。
[パッケージを選択] 画面で、事前に選択されているパッケージに以下を追加します。
インストールを完了します(下記を参照)。
建物
ダウンロード リストから libwebp-1.6.0.tar.gz
をダウンロードします。
パッケージを解凍します。これにより、libwebp-1.6.0/
という名前のディレクトリが作成されます。
tar xvzf libwebp-1.6.0.tar.gz
WebP エンコーダ cwebp
とデコーダ dwebp
をビルドします。
libwebp-1.6.0/
が抽出されたディレクトリに移動し、次のコマンドを実行します。
cd libwebp-1.6.0
./configure
make
sudo make install
これにより、libwebp
ライブラリ(動的および静的)とともに、cwebp
コマンドライン ツールと dwebp
コマンドライン ツールがビルドされてインストールされます。
これらのツールは通常、デフォルトで /usr/local/bin/
にインストールされます。ローカル バージョンは examples/
ディレクトリの下にビルドされます。
通常、ライブラリは /usr/local/lib/
ディレクトリにインストールされます。実行時エラーを回避するには、LD_LIBRARY_PATH
環境変数にこの場所が含まれていることを確認してください。通常、C ヘッダーは /usr/local/include/webp
の下にインストールされます。
その他のオプションを表示するには、次のコマンドを実行します。
./configure --help
次のステップ
画像の変換を開始する手順については、WebP の使用をご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-08 UTC。
[null,null,["最終更新日 2025-08-08 UTC。"],[[["\u003cp\u003eThis page provides instructions for building WebP utilities (\u003ccode\u003ecwebp\u003c/code\u003e and \u003ccode\u003edwebp\u003c/code\u003e) from source code if precompiled options are unsuitable.\u003c/p\u003e\n"],["\u003cp\u003eBuilding on Windows involves using Visual C++ with specific commands to compile the utilities and library.\u003c/p\u003e\n"],["\u003cp\u003eFor Unix-like platforms (Linux, macOS, Cygwin), instructions cover installing necessary dependencies before building the WebP tools.\u003c/p\u003e\n"],["\u003cp\u003eThe building process on Unix-like systems involves downloading the source code, configuring, compiling, and installing the utilities and libraries.\u003c/p\u003e\n"],["\u003cp\u003eAfter building the utilities, users can proceed to the "Using WebP" page for image conversion instructions.\u003c/p\u003e\n"]]],["To build WebP utilities: Windows users download `libwebp-1.5.0.tar.gz`, then use `nmake` in the `libwebp-1.5.0` directory to compile, producing `cwebp.exe` and `dwebp.exe` in the output. Unix-like users install `libjpeg`, `libpng`, `libtiff`, and `libgif` packages, then download and extract `libwebp-1.5.0.tar.gz`. Navigate to the directory and run `./configure`, `make`, and `sudo make install` to build and install `cwebp` and `dwebp`.\n"],null,["If the [precompiled utilities](/speed/webp/docs/precompiled) don't suit your\nneeds, you can build the WebP utilities yourself.\n\nCompiling on Windows with Visual C++\n\n1. Download `libwebp-1.5.0.tar.gz` from the [downloads list](https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html)\n and extract its contents.\n\n2. From the `libwebp-1.5.0` directory, run:\n\n nmake /f Makefile.vc CFG=release-static RTLIBCFG=static OBJDIR=output\n\n To see additional options, run: \n\n nmake /f Makefile.vc\n\n3. The directory `output\\release-static\\x86\\bin` or\n `output\\release-static\\x64\\bin` will contain the tools `cwebp.exe` and\n `dwebp.exe` depending on the platform being targeted. The directory\n `output\\release-static\\(x86|x64)\\lib` will contain the `libwebp` static\n library.\n\nCompiling on Unix-like Platforms\n\nPreparing the Platform\n\nLinux\n\n1. Install the `libjpeg`, `libpng`, `libtiff` and `libgif` packages, needed to\n convert between JPEG, PNG, TIFF, GIF and WebP image formats.\n\n Package management varies by Linux distribution. On Ubuntu and Debian, the\n following command will install the needed packages: \n\n sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev\n\n2. Complete the installation ([see below](#building)).\n\nmacOS\n\nMacPorts is a convenient way to satisfy dependencies. If you already have\nMacPorts installed, go directly to Step 3. Otherwise, follow these steps:\n\n1. Download MacPorts for your macOS version from the MacPorts\n [downloads site](https://distfiles.macports.org/MacPorts). MacPorts requires\n the installation of\n [Xcode](https://developer.apple.com/xcode/).\n\n2. Install MacPorts following the MacPorts\n [directions](https://guide.macports.org/).\n\n3. Update MacPorts:\n\n sudo port selfupdate\n\n4. Install the JPEG, PNG, TIFF and GIF dependencies:\n\n sudo port install jpeg libpng tiff giflib\n\n5. Complete the installation ([see below](#building)).\n\nCygwin\n\n1. Download setup.exe from the [Cygwin web page](https://www.cygwin.com).\n\n2. Run setup.exe and proceed through the installation.\n\n3. At the **Select Packages** screen, add to the pre-selected packages the\n following:\n\n - `libjpeg-devel`, `libpng-devel`, `libtiff-devel` and `libgif-devel`\n\n - `gcc`, `make` and `automake` (for building packages)\n\n4. Complete the installation ([see below](#building)).\n\nBuilding\n\n1. Download `libwebp-1.5.0.tar.gz` from the\n [downloads list](https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html).\n\n2. Untar or unzip the package. This creates a directory named `libwebp-1.5.0/`:\n\n tar xvzf libwebp-1.5.0.tar.gz\n\n3. Build WebP encoder `cwebp` and decoder `dwebp`:\n\n Go to the directory where `libwebp-1.5.0/` was extracted to\n and run the following commands: \n\n cd libwebp-1.5.0\n ./configure\n make\n sudo make install\n\n This builds and installs the `cwebp` and `dwebp` command line tools, along\n with the `libwebp` libraries (dynamic and static).\n\n These tools are usually installed under `/usr/local/bin/` by default. The\n local versions are built under the `examples/` directory.\n\n The library will usually be installed under the `/usr/local/lib/` directory.\n To avoid run-time errors, make sure that your `LD_LIBRARY_PATH` environment\n variable includes this location. The C headers are typically installed under\n `/usr/local/include/webp`.\n\n To see additional options, run: \n\n ./configure --help\n\nWhat Next?\n\nGo to [Using WebP](/speed/webp/docs/using) for instructions on how to start\nconverting your images."]]