> For the complete documentation index, see [llms.txt](https://r3dhummingbird.gitbook.io/live2d-cubism-cookbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://r3dhummingbird.gitbook.io/live2d-cubism-cookbook/common-gotchas/import-psd-files.md).

# Import PSD Files

The most important feature Photoshop provides is **Autocrop**. This ensures that all model component layers are compact and have no empty pixels. Many free drawing apps like Medibang, ibis Paint, or, GIMP, don't have this feature. However, we may achieve the same effect using the command line tool **imagemagick**.

```
# if you haven't installed homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# use homebrew to install imagemagick
brew install imagemagick
```

We can use **imagemagick** from the command line to extract each layer of our PSD file as a TIFF image, trim the empty pixels from each TIFF image, and stack the TIFF images as a layered PSD file. The ordering of the layers might have changed during the process.

```
convert live2d.psd tiff/img_%d.tiff
convert tiff/*.tiff -trim trimmed/img_%d.tiff
convert trimmed/*.tiff live2d_trimmed.psd
```


---

# 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:

```
GET https://r3dhummingbird.gitbook.io/live2d-cubism-cookbook/common-gotchas/import-psd-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
