# ed pare optimize

> Optimizes images, or every supported image inside folders, into copies and waits until the batch finishes.

- Canonical URL: https://getedith.pro/docs/cli/pare/optimize
- Updated: 2026-12-02

Optimizes images, or every supported image inside folders, into copies and
waits until the batch finishes.

Usage:

```
ed pare optimize <path>... [options] [--json]
```

Options:

| Name | Type / values | Default | What it does |
| --- | --- | --- | --- |
| `<path>` | files or folders | required | Folders are searched recursively. Hidden files are skipped. |
| `--lossy` / `--lossless` | flag | saved setting | Allows or forbids lossy PNG and JPEG results. |
| `--jpeg-quality` | 50 to 99 | 80 | Lossy JPEG quality. |
| `--png-quality` | 40 to 100 | 80 | Lowest lossy PNG quality. 100 keeps PNG lossless. |
| `--no-dither` | flag | off | Does not dither lossy PNG colors. |
| `--effort` | `fast`, `balanced`, `thorough` | `balanced` | How hard Pare searches for smaller output. |
| `--keep-metadata` / `--strip-metadata` | flag | strip | Keeps or removes camera, editor and comment data. |
| `--drop-color-profiles` / `--keep-color-profiles` | flag | keep | Removing profiles can change colors. |
| `--output` | folder | Pare's folder | Writes copies there. |
| `--alongside` | flag | off | Writes `name optimized.ext` next to each original. |
| `--keep-dates` | flag | off | Gives copies the original dates. |
| `--json` | flag | off | Prints the batch as JSON, as `ed pare status --json` does. |

Options apply to this run only. Use [`ed pare set`](https://getedith.pro/docs/cli/pare/set) to save them.
Copies never overwrite a file; a name that exists gets a number. At most 1024
paths can be given at once, and a run covers at most 10000 images. The command
exits non-zero when any image failed, after optimizing the rest.

```
$ ed pare optimize . --output optimized
FILE        STATUS      BEFORE     AFTER      SAVED  METHOD
broken.png  Failed      829 bytes  -          -      The file is damaged: truncated chunk.
icon.png    Optimized   553 bytes  530 bytes  4.2%   Lossless PNG
loader.gif  Optimized   223 bytes  198 bytes  11.2%  Metadata removed
logo.png    Optimized   1.7 KB     938 bytes  43.5%  Lossless PNG
photo.jpg   Optimized   3.9 KB     3.4 KB     12.7%  Lossless JPEG
pixel.gif   No savings  54 bytes   54 bytes   -      -
Saved 1.3 KB of 6.4 KB (19.7%)
error: 1 of 6 images failed
```

## Where to go next

- [`ed pare status`](https://getedith.pro/docs/cli/pare/status), to look at the batch again
- [`ed pare`](https://getedith.pro/docs/cli/pare), the rest of this group
- [All `ed` commands](https://getedith.pro/docs/cli)

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
