> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/ja/narejjibsu/113-optimising-very-large-image-files.md).

# 非常に大きな画像ファイルを最適化する

画像ファイルが過度に大きかったり、不適切なファイル形式を使用していたりすると、コンパイル処理が大幅に長引き、コンパイルのタイムアウトを引き起こす可能性があります。このヘルプ記事では、大きな画像ファイルの扱い方と、適切な画像ファイル形式の選び方についていくつかの提案を示します。

大きな画像ファイル（それぞれのサイズが 1MB を超える場合）については、ラスター画像（ラスター PDF 画像を含む）を、たとえば幅または高さを 1200px にしてリサイズし、ファイルサイズを小さくすることをお勧めします。これは画像編集プログラムで行えます。あるいは、ImageMagick を使用している場合は、次の [`convert` コマンド](http://www.imagemagick.org/Usage/resize)。MacOS では、 [`sips -Z` コマンド](http://lifehacker.com/5962420/batch-resize-images-quickly-in-the-os-x-terminal) は非常に便利です。

写真画像を保存する形式として `.png` でも、ファイルサイズが非常に大きくなることがあります： `.jpg` は通常、〜に対してはるかに容量効率のよい形式です *写真*. *線画、グラフ、図表* は、一般に、〜として保存する方が適しています。 `.png` または `.pdf`、一般に。 `.pdf` 画像は、〜と比べてコンパイルも速くなることがあります `.png` ファイルは、ファイルサイズが同程度であれば、コンパイル処理で呼び出す必要がなくなるため、 `libpng`.

〜の場合 `.eps` 画像については、次の形式への変換をお勧めします `.pdf`。PDF 形式は、線画のベクター性を維持しながら、ファイルサイズが小さくなることが多いためです。 [`epstopdf` コマンド](https://www.ctan.org/pkg/epstopdf) が便利です。GhostScript もインストールしておく必要があります。

どうしても使用する必要がある場合は `.eps` プロジェクトで画像を使用する場合、場合によってはその `.eps` ファイルは、書き出し元のアプリケーションの不具合や設定ミスのために、必要以上に大きくなっていることがあります。書き出し設定を変更してみるか、GhostScript でそのファイルを再処理して、ファイルサイズを比較してみてください：

```
gs -o outputfile.eps -sDEVICE=epswrite originalfile.eps
```

文書を作業している間にコンパイル／レンダリング時間を少しでも短縮したい場合は、次のように記述して "draft" モードを有効にすると、コンパイルを高速化できます。 `\documentclass[draft]{…}` を文書クラス宣言に記述してください。画像を PDF にレンダリングしないこと（およびいくつかの処理を省略すること）で、"draft" オプションはコンパイル時間の短縮に役立つことが多く、大きな文書を扱う際に便利です。

作業中のプロジェクトの特定の部分だけ、グラフィックスの表示をオン／オフにすることもできます：

```latex
\setkeys{Gin}{draft=false}
…ここにある任意の \includegraphics は完全に描画されるので、
この文書のこの部分の画像を確認できます..
\setkeys{Gin}{draft}
…ここにある任意の \includegraphics は、単なる空白の枠として表示されます。
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/ja/narejjibsu/113-optimising-very-large-image-files.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
