# allyhub frames compare

> How a candidate picture differs from a reference, as numbers (ΔE, channels, SSIM, levels, grain, edges, regions) with a heatmap and a side-by-side: a piece's moment, a picture file or a video file's frame

Source: https://allyhub.com/docs/reference/cli/frames-compare · AllyHub 0.10.0
Index of all docs: https://allyhub.com/llms.txt

## Usage

```bash
allyhub frames compare [reference] [candidate] [options]
```

## Arguments

| Argument | Type | What it is |
| --- | --- | --- |
| `<reference>` | string | The reference picture (PNG, WebP, JPEG…) |
| `<candidate>` | string | A piece (its id, its file without its extension, or its file; default the project's only one) at --at or --part's still; or a file by its extension: a picture (.png, .jpg, .webp…), or a video file's frame at --at (.mp4, .mov, .webm…) |

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `--combo` | list of string |  | The first combo matching name=value pairs joined with commas (lang=zh-cn,hook=b), or a combo's id (c03); default the first combo |
| `--at` | string |  | The moment: seconds (from the start of --part when given) or an anchor of the piece; a video file's are seconds (default 0) |
| `--part` | string |  | The piece's part --at counts from; alone, its still |
| `--ref-crop` | string |  | Cut the reference to x,y,width,height, or to an element of the elements.json beside it (frames web writes one) |
| `--crop` | string |  | Cut the candidate to x,y,width,height before any resize |
| `--encode` | string |  | Draw the candidate through this encode first, as a platform serves it: codec:kbps, h264 or hevc (hevc:618) |
| `--out` | string |  | Where its files go, a path without extension; default under .allyhub/work/compare/ |

## Parameters

Each is given as `--param name=value`.

| Name | Type | Default | What it does |
| --- | --- | --- | --- |
| `resize` | `stretch`, `width`, `none` | `"stretch"` | When sizes differ: stretch the candidate to the reference, scale it to its width, or compare the common area |
| `shift` | integer | `0` | Search the best offset within this many pixels each way |

## Global options

`--dir <value>`: the project's folder; default the one around where it is run. `--json`: print the result as JSON.

## Output

With `--json`, the command prints an object with these fields:

| Field | Type | What it is |
| --- | --- | --- |
| `reference` | string |  |
| `files` | object |  |

## Examples

```bash
allyhub frames compare reference.png launch/film --at 2.5 --encode hevc:618
allyhub frames compare reference.png shot.webp --ref-crop cta
allyhub frames compare reference.png theirs.mp4 --at 3
```

## Exit codes

`0` when it succeeds; the others are listed in [Exit codes](https://allyhub.com/docs/reference/cli/exit-codes.md).

## In the work

**decks**: Making a deck

[`slides capabilities`](https://allyhub.com/docs/reference/cli/slides-capabilities.md) → [`slides import`](https://allyhub.com/docs/reference/cli/slides-import.md) → [`check`](https://allyhub.com/docs/reference/cli/check.md) → [`frames`](https://allyhub.com/docs/reference/cli/frames.md) → `frames compare` → [`inspect layout`](https://allyhub.com/docs/reference/cli/inspect-layout.md) → [`inspect contrast`](https://allyhub.com/docs/reference/cli/inspect-contrast.md) → [`dev`](https://allyhub.com/docs/reference/cli/dev.md) → [`render`](https://allyhub.com/docs/reference/cli/render.md)

**websites**: Making a website: any web project, with its website JSON listed in allyhub.yaml

[`check`](https://allyhub.com/docs/reference/cli/check.md) → [`render`](https://allyhub.com/docs/reference/cli/render.md) → [`frames web`](https://allyhub.com/docs/reference/cli/frames-web.md) → `frames compare` → [`site deploy`](https://allyhub.com/docs/reference/cli/site-deploy.md) → [`site status`](https://allyhub.com/docs/reference/cli/site-status.md) → [`site live`](https://allyhub.com/docs/reference/cli/site-live.md)

**references**: Studying reference videos, and a piece against them

[`reference`](https://allyhub.com/docs/reference/cli/reference.md) → [`reference compare`](https://allyhub.com/docs/reference/cli/reference-compare.md) → [`reference set`](https://allyhub.com/docs/reference/cli/reference-set.md) → [`frames`](https://allyhub.com/docs/reference/cli/frames.md) → `frames compare` → [`words`](https://allyhub.com/docs/reference/cli/words.md) → [`audio`](https://allyhub.com/docs/reference/cli/audio.md) → [`align`](https://allyhub.com/docs/reference/cli/align.md)
