# storeshot

> Compose App Store marketing screenshots, bring images to an exact upload size, and read image sizes.

Source: https://air.build/docs/cli/storeshot/

`storeshot` makes App Store screenshots out of real app captures. It draws a marketing screenshot (a background color, a headline, and the capture inside a drawn phone), resizes an image to an exact pixel size, and prints the size of images. It works on local files only: it does not talk to App Store Connect. To upload the results, use [asc](https://air.build/docs/cli/asc/) (`asc screenshots upload`).

It runs in a Team's Environment, on cloud Teams and Mac Teams alike. Both get the same build with the same headline font beside it, so a screenshot composed on a Mac Team and one composed on a cloud Team come out as the same pixels. It needs no image library or font installed on the host.

## Synopsis

```bash
storeshot compose --bg '#RRGGBB' --headline 'LINE ONE|LINE TWO' \
    --screenshot <capture> --out <file.png> --size <W>x<H> \
    [--layout hero|device-top] [--fg '#RRGGBB'] [--font <path>]

storeshot resize --in <image> --out <file.png> --size <W>x<H> [--fit cover|stretch]

storeshot probe <image> [<image>...]

storeshot help
```

Flags take their value as the next word or after `=` (`--size=1284x2778`). `--help` or `-h` anywhere, or `storeshot help`, prints the usage.

## Get the size first

Every App Store screenshot slot accepts only certain pixel sizes. Read them from `asc` rather than from memory:

```bash
asc screenshots sizes          # the common iPhone and iPad slots
asc screenshots sizes --all    # every display type
```

`asc` prints sizes as `WxH`, the same form `--size` takes.

## compose

Draws one marketing screenshot at the exact size you give:

- the canvas filled with `--bg`;
- the headline, in capitals, centered, each line on its own row. The first line is set large and the others smaller. All of it stays inside the center 70% of the width, so cropping to a neighboring device size does not cut it off;
- the capture from `--screenshot` inside a drawn phone (dark body, rounded corners, a Dynamic Island and a soft shadow), 80% of the canvas wide.

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--bg` | `#RRGGBB` (the `#` is optional) | required | Background color. |
| `--headline` | text, lines separated by a vertical bar | required | The headline. Each line is trimmed and set in capitals; empty lines are dropped. |
| `--screenshot` | path to a PNG or JPEG | required | The real capture placed in the phone. Its aspect ratio decides the phone's height. |
| `--out` | path | required | Where to write the PNG. Missing folders are created. |
| `--size` | `WxH` in pixels, each side 1 to 20000 | required | The output size, for example `1284x2778`. |
| `--layout` | `hero`, `device-top` | `hero` | `hero`: headline at the top, phone below it running off the bottom edge. `device-top`: phone hanging from the top edge, headline underneath. |
| `--fg` | `#RRGGBB` | `#FFFFFF` | Headline color. |
| `--font` | path to a TrueType or OpenType font | Inter Black, shipped beside `storeshot` | The headline face. |

Font choice, in order: `--font`, then the `STORESHOT_FONT` environment variable, then the Inter Black file shipped beside the binary. If that file is missing, `storeshot` falls back to a bold system font and says so on stderr, because the result will no longer match other hosts.

A headline line that would have to shrink below a legible size to fit the center 70% is an error, not a smaller line. The message tells you about how many characters to cut it to.

## resize

Brings an image to an exact pixel size and writes it as a PNG without an alpha channel, which App Store Connect requires. Transparent areas end up black.

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--in` | path to a PNG or JPEG | required | The image to resize. |
| `--out` | path | required | Where to write the PNG. Missing folders are created. |
| `--size` | `WxH` in pixels, each side 1 to 20000 | required | The target size. |
| `--fit` | `cover`, `stretch` | `cover` | `cover` keeps the aspect ratio: it crops the side that overhangs (centered horizontally, kept to the top edge), then resamples. It never distorts. `stretch` resamples straight to the size, which is right only when the aspect ratios already match. |

## probe

Reads one or more images (PNG or JPEG) and prints each one's size as `WxH`, one line per image, in the order given. Use it to check a file before uploading.

## Output

`compose` and `resize` print the absolute path of the file they wrote, one line. `probe` prints sizes:

```text
1284x2778
2064x2752
```

Every image `storeshot` writes is an opaque PNG.

## Exit codes

| Code | Meaning |
| --- | --- |
| `0` | Done, or help was printed with `help` / `--help`. |
| `1` | An error. The message is on stderr, starting with `storeshot:`. |
| `2` | Run with no command at all; the usage was printed. |

## Errors

| Message | What to do |
| --- | --- |
| `missing --<flag>` | Add the flag; see the tables above for what each command needs. |
| `--<flag> needs a value` | The flag was last on the line with nothing after it. Give it a value. |
| `--size must be WxH in pixels up to 20000 a side, for example 1284x2778 (got '…')` | Pass the size as two whole numbers joined by `x`. Take it from `asc screenshots sizes`. |
| `'…' is not a #RRGGBB colour` | Use six hex digits, for example `#1F1F23`. |
| `--headline is empty; pass lines separated by '…'` | Give the headline some text. |
| `--layout must be one of hero, device-top` | Use one of those two values. |
| `--fit must be one of cover, stretch` | Use one of those two values. |
| `headline line '…' is too long to set inside the centre 70% and stay legible at thumbnail size; shorten it to about N characters or fewer` | Shorten that line, or split it into two with a vertical bar. |
| `… has no glyph for '…' (U+…); pass --font with a face that covers this headline` | The font cannot draw that character (for example, a non-Latin script or an emoji). Pass `--font` with a font that has it. |
| `font not found: …` | The `--font` path, or the `STORESHOT_FONT` path, does not exist. Fix the path. |
| `… is not a TrueType or OpenType font, or is truncated` | Point `--font` at a complete `.ttf` or `.otf` file. |
| `no usable font: …` | The shipped font is missing and no fallback was found. Pass `--font <path>`. |
| `cannot read …` / `cannot decode …: … (PNG and JPEG only)` | Check the path, and convert the image to PNG or JPEG. |
| `cannot write …` | The output folder cannot be written. Pick another `--out`. |
| `probe needs at least one image path` | Give `probe` one or more files. |
| `unknown command '…'` (followed by a pointer to `storeshot help`) | The commands are `compose`, `resize` and `probe`. `storeshot` has no `--version`. |

## Examples

Find the iPhone size, then compose a screenshot from a capture:

```bash
asc screenshots sizes --display-type "APP_IPHONE_65"
storeshot compose --bg '#1F1F23' --headline 'TRACK|EVERY SUBSCRIPTION' \
  --screenshot raw/01.png --out final/01.png --size 1284x2778
```

The second screenshot of a set, phone at the top, with a dark headline on a light background:

```bash
storeshot compose --bg '#F4F1EA' --fg '#1F1F23' --layout device-top \
  --headline 'SEE IT ALL|IN ONE PLACE' \
  --screenshot raw/02.png --out final/02.png --size 1284x2778
```

Bring a raw capture to an iPad size without distorting it, then check every file:

```bash
storeshot resize --in raw/ipad-01.png --out final/ipad-01.png --size 2064x2752
storeshot probe final/*.png
```

Upload the finished set (see [asc](https://air.build/docs/cli/asc/)):

```bash
asc screenshots upload --app "APP_ID" --version "1.2.3" --locale "en-US" \
  --path "./final" --device-type "IPHONE_65"
```
