@fleox/agentphoto 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +177 -72
- package/changelog.json +18 -0
- package/dist/agent/agentphoto.mjs +64 -17
- package/dist/agent/chunks/{assets-CDQo3VqD.mjs → assets-BZVUUHjg.mjs} +3 -3
- package/dist/agent/chunks/{context-DoLoLF9f.mjs → context-CNpRboiC.mjs} +1 -1
- package/dist/agent/chunks/{doc-BjY_j4Su.mjs → doc-D_v_yE07.mjs} +25 -286
- package/dist/agent/chunks/{export-CLmpFART.mjs → export-aNJcPNbJ.mjs} +1 -1
- package/dist/agent/chunks/geometry-BKIhUO9x.mjs +315 -0
- package/dist/agent/chunks/{models-C4i_hicr.mjs → models-CxrjmA0W.mjs} +1 -1
- package/dist/agent/chunks/{package-DSmAxrla.mjs → package-Cu1GyvKL.mjs} +2 -2
- package/dist/agent/chunks/{project-CUykGysG.mjs → project-o1DH2nOw.mjs} +12 -10
- package/dist/agent/chunks/{templates--YGpGuHh.mjs → templates-BJ2me4XZ.mjs} +24 -3
- package/dist/agent/chunks/{tools-Dnh8g6F9.mjs → tools-DKaAPEV5.mjs} +92 -27
- package/dist/agent/chunks/{tree-DO7N0UDV.mjs → tree-D8qZKPAb.mjs} +2 -2
- package/dist/engine/agentphoto-engine.js +408 -352
- package/dist/studio/assets/index-CmOzzoXv.css +1 -0
- package/dist/studio/assets/index-D3Iw5q8v.js +28 -0
- package/dist/studio/assets/{transformers.web-DgnCIB_X.js → transformers.web-osEqoMhg.js} +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/studio/templates/index.json +1 -1
- package/dist/studio/templates/product-white/photo.json +2 -2
- package/dist/studio/templates/product-white/preview.jpg +0 -0
- package/dist/studio/templates/product-white/template.json +1 -1
- package/package.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/skills/agentphoto-cutout/SKILL.md +30 -25
- package/plugin/skills/agentphoto-design/SKILL.md +24 -24
- package/plugin/skills/agentphoto-publish/SKILL.md +10 -10
- package/plugin/skills/agentphoto-retouch/SKILL.md +26 -26
- package/plugin/skills/agentphoto-retouch/references/filters.md +1 -1
- package/plugin/skills/agentphoto-retouch/references/patch-ops.md +14 -13
- package/plugin/skills/agentphoto-retouch/references/recipes.md +3 -3
- package/templates/product-white/photo.json +2 -2
- package/templates/product-white/preview.jpg +0 -0
- package/templates/product-white/template.json +1 -1
- package/dist/studio/assets/index-Be8JnaFy.js +0 -28
- package/dist/studio/assets/index-DwPms2S5.css +0 -1
|
@@ -4,7 +4,7 @@ description: Design social media and marketing visuals with AgentPhoto - YouTube
|
|
|
4
4
|
license: PolyForm-Noncommercial-1.0.0
|
|
5
5
|
compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge/Brave) for renders.
|
|
6
6
|
metadata:
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.1"
|
|
8
8
|
repository: "https://github.com/fleox/agentphoto"
|
|
9
9
|
allowed-tools: Bash Read Write
|
|
10
10
|
---
|
|
@@ -13,7 +13,7 @@ allowed-tools: Bash Read Write
|
|
|
13
13
|
|
|
14
14
|
**Language:** talk to the user in their language; keep commands, ids and files in English. Text that appears **in the image** is in the language the user wants on the visual.
|
|
15
15
|
|
|
16
|
-
Every command is `npx -y @fleox/agentphoto@0.1.
|
|
16
|
+
Every command is `npx -y @fleox/agentphoto@0.1.1 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false. Basics (filters, render, patches): skill `agentphoto-retouch`; cut-outs: skill `agentphoto-cutout`.
|
|
17
17
|
|
|
18
18
|
## 1. Brief
|
|
19
19
|
|
|
@@ -22,10 +22,10 @@ Get, or decide and say: the **format** (where it will be posted), the **message*
|
|
|
22
22
|
## 2. Start from a template (fastest)
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npx -y @fleox/agentphoto@0.1.
|
|
26
|
-
npx -y @fleox/agentphoto@0.1.
|
|
27
|
-
npx -y @fleox/agentphoto@0.1.
|
|
28
|
-
npx -y @fleox/agentphoto@0.1.
|
|
25
|
+
npx -y @fleox/agentphoto@0.1.1 templates list --json
|
|
26
|
+
npx -y @fleox/agentphoto@0.1.1 templates show youtube-thumbnail --json
|
|
27
|
+
npx -y @fleox/agentphoto@0.1.1 new thumb --template youtube-thumbnail --image ./photo.jpg --json
|
|
28
|
+
npx -y @fleox/agentphoto@0.1.1 render --project thumb --json
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
The photo goes into the template's **slot** layer (`slot` in `templates list`, usually `photo`), keeping its box, fit, filters and effects. Templates: `youtube-thumbnail` (1280×720), `og-article` (1200×630), `social-quote` (1080×1080), `story-promo` (1080×1920), `sale-banner` (1920×600), `polaroid` (1080×1350), `avatar-pro` (800×800), `product-white` (2000×2000). `templates list --category social` or `--query sale` filters them.
|
|
@@ -33,33 +33,33 @@ The photo goes into the template's **slot** layer (`slot` in `templates list`, u
|
|
|
33
33
|
Then make it the user's:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
npx -y @fleox/agentphoto@0.1.
|
|
37
|
-
npx -y @fleox/agentphoto@0.1.
|
|
38
|
-
npx -y @fleox/agentphoto@0.1.
|
|
39
|
-
npx -y @fleox/agentphoto@0.1.
|
|
36
|
+
npx -y @fleox/agentphoto@0.1.1 doc summary --project thumb --json
|
|
37
|
+
npx -y @fleox/agentphoto@0.1.1 layer update title --set 'text="3 tricks\nnobody uses"' --project thumb --json
|
|
38
|
+
npx -y @fleox/agentphoto@0.1.1 layer update kicker --set text="TESTED" --set background.color=#00e0a4 --project thumb --json
|
|
39
|
+
npx -y @fleox/agentphoto@0.1.1 doc patch --project thumb --json '[{"op":"set","path":"canvas.background","value":{"type":"linear","angle":20,"stops":["#04131f","#0b5d7a","#00e0a4"]}}]'
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
Templates described as "cut-out" (`youtube-thumbnail`, `avatar-pro`, `product-white`) look right only once the subject is cut out: run `remove-bg photo` (skill `agentphoto-cutout`), then render.
|
|
42
|
+
Templates described as "cut-out" (`youtube-thumbnail`, `avatar-pro`, `product-white`) look right only once the subject is cut out: run `remove-bg photo` (skill `agentphoto-cutout`), then render. On `product-white` the first cut-out of the user's photo also scales and places the product on the floor shadow; elsewhere, recentre a subject with the `fitLayer` patch op if it sits badly.
|
|
43
43
|
|
|
44
44
|
## 3. Or start from a size preset
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
npx -y @fleox/agentphoto@0.1.
|
|
48
|
-
npx -y @fleox/agentphoto@0.1.
|
|
49
|
-
npx -y @fleox/agentphoto@0.1.
|
|
50
|
-
npx -y @fleox/agentphoto@0.1.
|
|
51
|
-
npx -y @fleox/agentphoto@0.1.
|
|
52
|
-
npx -y @fleox/agentphoto@0.1.
|
|
53
|
-
npx -y @fleox/agentphoto@0.1.
|
|
54
|
-
npx -y @fleox/agentphoto@0.1.
|
|
55
|
-
npx -y @fleox/agentphoto@0.1.
|
|
47
|
+
npx -y @fleox/agentphoto@0.1.1 catalog sizes --json
|
|
48
|
+
npx -y @fleox/agentphoto@0.1.1 new launch --size og --background "#0f172a" --json
|
|
49
|
+
npx -y @fleox/agentphoto@0.1.1 assets add ./photo.jpg --license proprietary --add-layer --layer-id photo --project launch --json
|
|
50
|
+
npx -y @fleox/agentphoto@0.1.1 layer update photo --set x=600 --set y=0 --set width=600 --set height=630 --set fit=cover --project launch --json
|
|
51
|
+
npx -y @fleox/agentphoto@0.1.1 mask set photo --mask '{"gradient":{"type":"linear","angle":0,"stops":["black","white"]}}' --project launch --json
|
|
52
|
+
npx -y @fleox/agentphoto@0.1.1 layer add --id title --text "Find your quiet place" --set x=64 --set y=200 --set width=500 --set font=playfair --set size=72 --set weight=700 --set lineHeight=1.05 --set color=#f8fafc --project launch --json
|
|
53
|
+
npx -y @fleox/agentphoto@0.1.1 layer add --id kicker --text "NEW GUIDE" --set x=64 --set y=150 --set font=inter --set weight=700 --set size=22 --set letterSpacing=4 --set color=#38bdf8 --project launch --json
|
|
54
|
+
npx -y @fleox/agentphoto@0.1.1 layer add --layer '{"id":"rule","type":"shape","shape":"rect","x":64,"y":420,"width":80,"height":6,"radius":3,"fill":"#38bdf8"}' --project launch --json
|
|
55
|
+
npx -y @fleox/agentphoto@0.1.1 render --project launch --json
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
Presets: `og` 1200×630, `square` 1080×1080, `portrait` 1080×1350, `story` 1080×1920, `landscape` 1920×1080, `youtube` 1280×720, `twitter` 1600×900, `pinterest` 1000×1500, `banner` 1920×600, `linkedin-banner` 1584×396, `avatar` 800×800, `product` 2000×2000, `a4` 1240×1754. `fit: "cover"` + `focus: [x, y]` (0..1) frames a photo in any box without distortion.
|
|
59
59
|
|
|
60
60
|
## 4. Typography
|
|
61
61
|
|
|
62
|
-
15 bundled fonts (no web fonts, identical on every computer): `npx -y @fleox/agentphoto@0.1.
|
|
62
|
+
15 bundled fonts (no web fonts, identical on every computer): `npx -y @fleox/agentphoto@0.1.1 catalog fonts --json` lists them with weights.
|
|
63
63
|
|
|
64
64
|
| Mood | Title font | Body / small text |
|
|
65
65
|
|---|---|---|
|
|
@@ -82,7 +82,7 @@ Effects that keep text readable on photos: `stroke` (`{ "color": "#12082e", "wid
|
|
|
82
82
|
- **Faces and subjects** on the opposite side from the text, looking towards it when possible; never crop through eyes or chins.
|
|
83
83
|
- **Thumbnail test**: the visual must still read at small size. Render a small preview and look:
|
|
84
84
|
```bash
|
|
85
|
-
npx -y @fleox/agentphoto@0.1.
|
|
85
|
+
npx -y @fleox/agentphoto@0.1.1 render --project thumb --max-width 320 --json
|
|
86
86
|
```
|
|
87
87
|
- **Brand colours**: reuse the user's hex values exactly; derive dark / light tints for backgrounds rather than adding new hues.
|
|
88
88
|
|
|
@@ -91,8 +91,8 @@ More layouts (composition grids per format, colour pairs, badge and pill recipes
|
|
|
91
91
|
## 6. Check and deliver
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
|
-
npx -y @fleox/agentphoto@0.1.
|
|
95
|
-
npx -y @fleox/agentphoto@0.1.
|
|
94
|
+
npx -y @fleox/agentphoto@0.1.1 check --project thumb --json
|
|
95
|
+
npx -y @fleox/agentphoto@0.1.1 export --project thumb --format jpeg --quality 90 --json
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
`check` flags text that may run off the canvas, layers outside it and upscaled (soft) photos. Several sizes from one design (export `--variants`, `fit` cover / contain) and web weights: skill `agentphoto-publish`. For a set of variants (A/B titles, colours), copy the project folder per variant, change it and render each; show the user the renders side by side.
|
|
@@ -4,7 +4,7 @@ description: Export and deliver AgentPhoto images - run the pre-export check, pi
|
|
|
4
4
|
license: PolyForm-Noncommercial-1.0.0
|
|
5
5
|
compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge/Brave) for exports and the Studio.
|
|
6
6
|
metadata:
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.1"
|
|
8
8
|
repository: "https://github.com/fleox/agentphoto"
|
|
9
9
|
allowed-tools: Bash Read Write
|
|
10
10
|
---
|
|
@@ -13,13 +13,13 @@ allowed-tools: Bash Read Write
|
|
|
13
13
|
|
|
14
14
|
**Language:** talk to the user in their language; keep commands, ids and files in English.
|
|
15
15
|
|
|
16
|
-
Every command is `npx -y @fleox/agentphoto@0.1.
|
|
16
|
+
Every command is `npx -y @fleox/agentphoto@0.1.1 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
|
|
17
17
|
|
|
18
18
|
## 1. Check first
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
npx -y @fleox/agentphoto@0.1.
|
|
22
|
-
npx -y @fleox/agentphoto@0.1.
|
|
21
|
+
npx -y @fleox/agentphoto@0.1.1 check --project my-photo --json
|
|
22
|
+
npx -y @fleox/agentphoto@0.1.1 render --project my-photo --json
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
`check` exits 1 when there are errors (missing files, invalid document). Fix warnings too: `upscaled` (the photo is stretched beyond its resolution: it will look soft; use a smaller output or a larger source), `off-canvas` (a layer is outside the picture), `text-may-overflow` (look at the render). `licences` lists the files whose licence needs a credit: tell the user. Look at the final render once more before exporting.
|
|
@@ -27,9 +27,9 @@ npx -y @fleox/agentphoto@0.1.0 render --project my-photo --json
|
|
|
27
27
|
## 2. Export
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
npx -y @fleox/agentphoto@0.1.
|
|
31
|
-
npx -y @fleox/agentphoto@0.1.
|
|
32
|
-
npx -y @fleox/agentphoto@0.1.
|
|
30
|
+
npx -y @fleox/agentphoto@0.1.1 export --project my-photo --json
|
|
31
|
+
npx -y @fleox/agentphoto@0.1.1 export --project my-photo --format jpeg --quality 85 --width 1600 --json
|
|
32
|
+
npx -y @fleox/agentphoto@0.1.1 export --project my-photo --format webp --quality 80 --out dist/web/hero.webp --json
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
Files go to `<project>/dist/` (`dist/<name>[-<preset or size>].<ext>`; `--name` sets the base name, `--out` an exact path inside the project). The result lists each file with `width`, `height` and `kb`: report them to the user with the absolute `file` path. Exporting over an existing file prints `needsConfirmation` with the plan: ask, then re-run with `--yes`.
|
|
@@ -45,12 +45,12 @@ JPEG has no alpha: transparent areas are flattened on white, or on `--background
|
|
|
45
45
|
|
|
46
46
|
## 3. Sizes and variants
|
|
47
47
|
|
|
48
|
-
`--preset` picks a platform size (`npx -y @fleox/agentphoto@0.1.
|
|
48
|
+
`--preset` picks a platform size (`npx -y @fleox/agentphoto@0.1.1 catalog sizes --json`): `og` 1200×630, `square` 1080×1080, `portrait` 1080×1350, `story` 1080×1920, `landscape` 1920×1080, `youtube` 1280×720, `twitter` 1600×900, `pinterest` 1000×1500, `banner` 1920×600, `linkedin-banner` 1584×396, `avatar` 800×800, `product` 2000×2000, `a4` 1240×1754. Or `--width` / `--height` (the other side keeps the aspect) or `--scale 2` (retina).
|
|
49
49
|
|
|
50
50
|
When the output aspect differs from the canvas, `--fit cover` (default) crops the centre and `--fit contain` pads with `--background`. Several outputs in one call:
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
npx -y @fleox/agentphoto@0.1.
|
|
53
|
+
npx -y @fleox/agentphoto@0.1.1 export --project my-photo --variants '[{"preset":"og","format":"jpeg","quality":85},{"preset":"square","format":"webp","fit":"contain","background":"#0f172a"},{"preset":"twitter","format":"jpeg"}]' --json
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Read the variants whose aspect changed (a landscape design cropped to `story` loses its sides): if a crop cuts text or a face, design that format separately (copy the project, change the canvas with `doc patch` `resizeCanvas`, move the layers; skill `agentphoto-design`) instead of relying on `cover`.
|
|
@@ -67,7 +67,7 @@ Read the variants whose aspect changed (a landscape design cropped to `story` lo
|
|
|
67
67
|
The Studio is a visual editor (canvas, layers, inspector, filters and looks, masks, AI cut-out, export, an optional assistant) that edits the **same project folder** through a local server on 127.0.0.1. Changes made by the agent in a terminal appear live in it, and changes the user makes are saved to `photo.json`.
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
|
-
npx -y @fleox/agentphoto@0.1.
|
|
70
|
+
npx -y @fleox/agentphoto@0.1.1 studio --project my-photo --json
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
It runs until stopped: start it in the background (or ask the user to run it in their own terminal), give them the `url` it prints, and stop it when they are done. `--no-open` doesn't open a browser, `--port <n>` picks the port. After they edit, run `doc summary` before changing anything: the document may have new layers (painted edits are files in `assets/edits/`).
|
|
@@ -4,7 +4,7 @@ description: Retouch a photo with AgentPhoto - open the user's photo as a non-de
|
|
|
4
4
|
license: PolyForm-Noncommercial-1.0.0
|
|
5
5
|
compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge/Brave) for renders and AI masks.
|
|
6
6
|
metadata:
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.1"
|
|
8
8
|
repository: "https://github.com/fleox/agentphoto"
|
|
9
9
|
allowed-tools: Bash Read Write
|
|
10
10
|
---
|
|
@@ -15,21 +15,21 @@ A project is a folder: `photo.json` (the document: a stack of layers, bottom to
|
|
|
15
15
|
|
|
16
16
|
**Language:** talk to the user in their language; keep commands, ids and files in English.
|
|
17
17
|
|
|
18
|
-
Every command is `npx -y @fleox/agentphoto@0.1.
|
|
18
|
+
Every command is `npx -y @fleox/agentphoto@0.1.1 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false. The first command can take a minute (npx install); `doctor` checks Node, Chrome and a test render.
|
|
19
19
|
|
|
20
20
|
## 1. Open the photo
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npx -y @fleox/agentphoto@0.1.
|
|
24
|
-
npx -y @fleox/agentphoto@0.1.
|
|
23
|
+
npx -y @fleox/agentphoto@0.1.1 doctor --json
|
|
24
|
+
npx -y @fleox/agentphoto@0.1.1 new my-photo --image ./photo.jpg --json
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
The photo is copied into `my-photo/assets/images/`, becomes the layer `photo` and sets the canvas size. An existing project: start with `info`. Then measure and look:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
npx -y @fleox/agentphoto@0.1.
|
|
31
|
-
npx -y @fleox/agentphoto@0.1.
|
|
32
|
-
npx -y @fleox/agentphoto@0.1.
|
|
30
|
+
npx -y @fleox/agentphoto@0.1.1 info --project my-photo --json
|
|
31
|
+
npx -y @fleox/agentphoto@0.1.1 analyze --project my-photo --json
|
|
32
|
+
npx -y @fleox/agentphoto@0.1.1 render --project my-photo --json
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
Read the image `render` prints (`data.files[0]`, an absolute path) with the Read tool. **Always look before and after each change**: you cannot judge colours, crops or skin from numbers.
|
|
@@ -41,16 +41,16 @@ Read the image `render` prints (`data.files[0]`, an absolute path) with the Read
|
|
|
41
41
|
Put global corrections in an **adjustment layer** on top: it affects every layer below, stays editable, and one `render --compare` shows before / after.
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
npx -y @fleox/agentphoto@0.1.
|
|
45
|
-
npx -y @fleox/agentphoto@0.1.
|
|
44
|
+
npx -y @fleox/agentphoto@0.1.1 layer add --project my-photo --json --layer '{"id":"correct","type":"adjustment","name":"Correction","filters":[{"type":"levels","black":20,"white":235,"gamma":1.05},{"type":"temperature","temperature":-8},{"type":"vibrance","vibrance":20}]}'
|
|
45
|
+
npx -y @fleox/agentphoto@0.1.1 render --project my-photo --compare --json
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
`--compare` writes `preview-before.png` (no filters, no adjustment layers) and `preview.png`: read both. Then tune one filter by its index (`layer list` shows the order) or add another:
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
npx -y @fleox/agentphoto@0.1.
|
|
52
|
-
npx -y @fleox/agentphoto@0.1.
|
|
53
|
-
npx -y @fleox/agentphoto@0.1.
|
|
51
|
+
npx -y @fleox/agentphoto@0.1.1 filter update correct 0 --set black=28 --set white=228 --project my-photo --json
|
|
52
|
+
npx -y @fleox/agentphoto@0.1.1 filter add correct --type curves --set 'rgb=[[0,0],[64,54],[192,204],[255,255]]' --project my-photo --json
|
|
53
|
+
npx -y @fleox/agentphoto@0.1.1 filter remove correct 2 --project my-photo --json
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
| Problem (what you see / what analyze says) | Filter (real parameters) |
|
|
@@ -64,7 +64,7 @@ npx -y @fleox/agentphoto@0.1.0 filter remove correct 2 --project my-photo --json
|
|
|
64
64
|
| Soft | `{"type":"sharpen","amount":60,"radius":1,"threshold":4}` on the photo layer |
|
|
65
65
|
| Lacks texture / depth | `{"type":"clarity","amount":15}` |
|
|
66
66
|
|
|
67
|
-
Every filter takes `amount` (0..1, blend with the unfiltered pixels) and `enabled` (false keeps it but skips it). The full list with ranges and defaults: `npx -y @fleox/agentphoto@0.1.
|
|
67
|
+
Every filter takes `amount` (0..1, blend with the unfiltered pixels) and `enabled` (false keeps it but skips it). The full list with ranges and defaults: `npx -y @fleox/agentphoto@0.1.1 catalog filters --json`, one filter: `catalog filters curves`. Cheat-sheet: [references/filters.md](references/filters.md).
|
|
68
68
|
|
|
69
69
|
Keep corrections moderate: one strong change looks edited. Stop when the render looks natural.
|
|
70
70
|
|
|
@@ -73,7 +73,7 @@ Keep corrections moderate: one strong change looks edited. Stop when the render
|
|
|
73
73
|
A look is a graded style in one filter (`bw`, `noir`, `sepia`, `vintage`, `polaroid`, `lomo`, `warm`, `cool`, `sunset`, `fade`, `punch`, `cinema`, `cyberpunk`, `cross-process`, `dramatic`, `dreamy`, `matte`, `golden-hour`, `film`, `clean`). Use `amount` 0.5..0.8 for a subtle grade:
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
npx -y @fleox/agentphoto@0.1.
|
|
76
|
+
npx -y @fleox/agentphoto@0.1.1 filter add correct --filter '{"type":"look","look":"film","amount":0.6}' --project my-photo --json
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
Offering options: render each candidate (`filter update correct <index> --set look='"cinema"'`), show the user the images, keep the one they choose.
|
|
@@ -82,18 +82,18 @@ Offering options: render each candidate (`filter update correct <index> --set lo
|
|
|
82
82
|
|
|
83
83
|
1. Select the skin on a **copy** of the photo with Segment Anything points in layer pixels (`[x, y, 1]` include, `[x, y, 0]` exclude). Click forehead, both cheeks and chin; exclude eyes and lips. Coordinates come from the full-size canvas: estimate them on the render (`size` vs `canvas` in its output gives the scale).
|
|
84
84
|
```bash
|
|
85
|
-
npx -y @fleox/agentphoto@0.1.
|
|
86
|
-
npx -y @fleox/agentphoto@0.1.
|
|
85
|
+
npx -y @fleox/agentphoto@0.1.1 mask generate photo --method points --points '[[768,352,1],[620,640,1],[950,640,1],[784,880,1],[640,496,0],[912,496,0]]' --target copy --copy-id skin --feather 6 --project my-photo --json
|
|
86
|
+
npx -y @fleox/agentphoto@0.1.1 render --project my-photo --layer skin --json
|
|
87
87
|
```
|
|
88
88
|
The layer render must show only skin (eyes as holes). Wrong area: run it again with more or other points (it replaces the copy's mask), or use `--method box`.
|
|
89
89
|
2. Smooth the copy only (edge-preserving, keeps pores visible at amount < 1):
|
|
90
90
|
```bash
|
|
91
|
-
npx -y @fleox/agentphoto@0.1.
|
|
91
|
+
npx -y @fleox/agentphoto@0.1.1 filter add skin --type surfaceBlur --set radius=10 --set threshold=20 --set amount=0.7 --project my-photo --json
|
|
92
92
|
```
|
|
93
93
|
3. Light and pop for the whole picture in the adjustment layer: `shadowsHighlights` (shadows 20..35 opens eye sockets), `clarity` 10..15, `vibrance` 15..20, a slight warm `temperature` if the skin looks grey.
|
|
94
94
|
4. Zoom on the face at 1:1 and look: plastic skin means a lower `amount` or `radius`.
|
|
95
95
|
```bash
|
|
96
|
-
npx -y @fleox/agentphoto@0.1.
|
|
96
|
+
npx -y @fleox/agentphoto@0.1.1 render --project my-photo --zoom 560,300,480,480 --json
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
Never change a face's shape, skin tone or identity beyond what the user asked.
|
|
@@ -103,9 +103,9 @@ Never change a face's shape, skin tone or identity beyond what the user asked.
|
|
|
103
103
|
Geometry ops move every layer so the picture stays the same (nothing is rasterised). Straighten first, then crop, then resize:
|
|
104
104
|
|
|
105
105
|
```bash
|
|
106
|
-
npx -y @fleox/agentphoto@0.1.
|
|
107
|
-
npx -y @fleox/agentphoto@0.1.
|
|
108
|
-
npx -y @fleox/agentphoto@0.1.
|
|
106
|
+
npx -y @fleox/agentphoto@0.1.1 layer update photo --set rotation=-2 --set x=-30 --set y=-20 --set width=1660 --set height=1107 --project my-photo --json
|
|
107
|
+
npx -y @fleox/agentphoto@0.1.1 doc patch --project my-photo --json '[{"op":"crop","x":0,"y":0,"width":1600,"height":900}]'
|
|
108
|
+
npx -y @fleox/agentphoto@0.1.1 doc patch --project my-photo --json '[{"op":"resizeImage","width":1280}]'
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
- Straighten: rotate the photo layer (degrees, clockwise) and enlarge it around its centre so no corner shows (about 3.5 % per degree); render and check the four corners. Do it before making copies of the photo (section 4): a copy keeps its own rotation and box, so apply the same `--set` values to it, or straighten first.
|
|
@@ -117,9 +117,9 @@ All patch ops, paths and shortcuts: [references/patch-ops.md](references/patch-o
|
|
|
117
117
|
## 6. Text, shapes, effects
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
|
-
npx -y @fleox/agentphoto@0.1.
|
|
121
|
-
npx -y @fleox/agentphoto@0.1.
|
|
122
|
-
npx -y @fleox/agentphoto@0.1.
|
|
120
|
+
npx -y @fleox/agentphoto@0.1.1 layer add --layer '{"id":"band","type":"shape","shape":"rect","x":0,"y":560,"width":1280,"height":160,"fill":{"type":"linear","angle":90,"stops":["rgba(0,0,0,0)","rgba(0,0,0,0.55)"]}}' --project my-photo --json
|
|
121
|
+
npx -y @fleox/agentphoto@0.1.1 layer add --id caption --text "Summer 2026" --set x=48 --set y=610 --set font=playfair --set size=64 --set color=#ffffff --project my-photo --json
|
|
122
|
+
npx -y @fleox/agentphoto@0.1.1 layer update caption --set effects.dropShadow.blur=18 --set effects.dropShadow.opacity=0.45 --project my-photo --json
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
Fonts are bundled (`catalog fonts`); effects: `dropShadow`, `outerGlow`, `innerShadow`, `stroke`, `colorOverlay` (`catalog effects`). Layout rules and typography: skill `agentphoto-design`.
|
|
@@ -127,8 +127,8 @@ Fonts are bundled (`catalog fonts`); effects: `dropShadow`, `outerGlow`, `innerS
|
|
|
127
127
|
## 7. Check and export
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
|
-
npx -y @fleox/agentphoto@0.1.
|
|
131
|
-
npx -y @fleox/agentphoto@0.1.
|
|
130
|
+
npx -y @fleox/agentphoto@0.1.1 check --project my-photo --json
|
|
131
|
+
npx -y @fleox/agentphoto@0.1.1 export --project my-photo --format jpeg --quality 88 --json
|
|
132
132
|
```
|
|
133
133
|
|
|
134
134
|
`check` must report no errors (missing files, invalid filters) and you should fix warnings (upscaled photo, layer off the canvas). The export lands in `my-photo/dist/`. Give the user the path; formats, sizes and variants: skill `agentphoto-publish`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Filters cheat-sheet
|
|
2
2
|
|
|
3
|
-
The catalog is the source of truth: `npx -y @fleox/agentphoto@0.1.
|
|
3
|
+
The catalog is the source of truth: `npx -y @fleox/agentphoto@0.1.1 catalog filters --json` lists every filter with its parameters (type, range, default) and an example; `npx -y @fleox/agentphoto@0.1.1 catalog filters shadowsHighlights --json` shows one. Unknown ids or parameters fail validation with a "did you mean" hint.
|
|
4
4
|
|
|
5
5
|
A filter is `{ "type": "<id>", ...params }` plus two common parameters: `amount` (0..1, blend with the unfiltered pixels, default 1) and `enabled` (false = kept but skipped). On an image / text / shape layer it changes that layer; on an **adjustment layer** it changes everything below it (inside its group).
|
|
6
6
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
`doc patch` applies a list of ops **atomically**: they are applied in order, the result is validated, and nothing is written if any op fails or the document becomes invalid (`error.details.opIndex` says which op). `--dry-run` prints the plan without writing; removing layers prints `needsConfirmation` until `--yes`.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npx -y @fleox/agentphoto@0.1.
|
|
7
|
-
npx -y @fleox/agentphoto@0.1.
|
|
8
|
-
npx -y @fleox/agentphoto@0.1.
|
|
6
|
+
npx -y @fleox/agentphoto@0.1.1 doc patch --project my-photo --file ops.json --dry-run --json
|
|
7
|
+
npx -y @fleox/agentphoto@0.1.1 doc patch --project my-photo --file ops.json --json
|
|
8
|
+
npx -y @fleox/agentphoto@0.1.1 doc patch --project my-photo --json '[{"op":"set","path":"layers#title.size","value":96}]'
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Ops
|
|
@@ -31,6 +31,7 @@ npx -y @fleox/agentphoto@0.1.0 doc patch --project my-photo --json '[{"op":"set"
|
|
|
31
31
|
| `resizeImage` | `{ "op": "resizeImage", "width": 1280 }` (or `height`, `scale`: scales every layer) |
|
|
32
32
|
| `rotateCanvas` | `{ "op": "rotateCanvas", "angle": 90 }` (90, 180, 270 clockwise) |
|
|
33
33
|
| `flipCanvas` | `{ "op": "flipCanvas", "axis": "horizontal" }` (text layers move but stay readable) |
|
|
34
|
+
| `fitLayer` | `{ "op": "fitLayer", "id": "photo", "subject": { "x": 881, "y": 306, "width": 475, "height": 329 }, "box": { "x": 160, "y": 90, "width": 1280, "height": 720 }, "anchor": "center" }` (scales and moves one layer so `subject` — canvas px, e.g. `remove-bg`'s `data.subject`; default the whole layer — fits `box`; `anchor` `bottom` stands it on a floor line) |
|
|
34
35
|
|
|
35
36
|
All of these ops were run together on one project (`set`, `addLayer`, `updateLayer`, `merge`, `addFilter` × 2, `updateFilter`, `removeFilter`, `duplicateLayer`, `moveLayer`, `groupLayers`, `setMask`, `set` on a mask field, `remove` in one patch; then `ungroup`, `removeLayer`, `resizeCanvas`, `rotateCanvas`, `flipCanvas` with `--yes`).
|
|
36
37
|
|
|
@@ -44,16 +45,16 @@ All of these ops were run together on one project (`set`, `addLayer`, `updateLay
|
|
|
44
45
|
## Shortcuts (same validation, same plans)
|
|
45
46
|
|
|
46
47
|
```bash
|
|
47
|
-
npx -y @fleox/agentphoto@0.1.
|
|
48
|
-
npx -y @fleox/agentphoto@0.1.
|
|
49
|
-
npx -y @fleox/agentphoto@0.1.
|
|
50
|
-
npx -y @fleox/agentphoto@0.1.
|
|
51
|
-
npx -y @fleox/agentphoto@0.1.
|
|
52
|
-
npx -y @fleox/agentphoto@0.1.
|
|
53
|
-
npx -y @fleox/agentphoto@0.1.
|
|
54
|
-
npx -y @fleox/agentphoto@0.1.
|
|
55
|
-
npx -y @fleox/agentphoto@0.1.
|
|
56
|
-
npx -y @fleox/agentphoto@0.1.
|
|
48
|
+
npx -y @fleox/agentphoto@0.1.1 layer update title --set size=96 --set color=#ffd166 --project my-photo --json
|
|
49
|
+
npx -y @fleox/agentphoto@0.1.1 layer update title --set effects.dropShadow.blur=24 --project my-photo --json
|
|
50
|
+
npx -y @fleox/agentphoto@0.1.1 layer update title --set mask=null --project my-photo --json
|
|
51
|
+
npx -y @fleox/agentphoto@0.1.1 layer move title --above photo --project my-photo --json
|
|
52
|
+
npx -y @fleox/agentphoto@0.1.1 filter add photo --type exposure --set exposure=0.3 --project my-photo --json
|
|
53
|
+
npx -y @fleox/agentphoto@0.1.1 filter update photo 0 --set exposure=0.2 --project my-photo --json
|
|
54
|
+
npx -y @fleox/agentphoto@0.1.1 mask set photo --mask '{"gradient":{"type":"linear","angle":0,"stops":["black","white"]}}' --project my-photo --json
|
|
55
|
+
npx -y @fleox/agentphoto@0.1.1 mask clear photo --project my-photo --json
|
|
56
|
+
npx -y @fleox/agentphoto@0.1.1 layer remove title --project my-photo --json
|
|
57
|
+
npx -y @fleox/agentphoto@0.1.1 layer remove title --yes --project my-photo --json
|
|
57
58
|
```
|
|
58
59
|
|
|
59
60
|
`--set` takes dotted keys and JSON values: numbers and `true` / `false` / `null` are parsed, other text stays a string (`--set color=#ffd166`, `--set font=inter`); arrays and objects need quotes (`--set 'focus=[0.5,0.3]'`), and so does text with a line break, as a JSON string (`--set 'text="Line one\nline two"'`).
|
|
@@ -5,9 +5,9 @@ Each document below passed `doc validate` with no warning, `check` with no issue
|
|
|
5
5
|
Apply one to a project (replaces the whole document: `--dry-run` first, `--yes` after the user agreed if it removes layers), then render:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx -y @fleox/agentphoto@0.1.
|
|
9
|
-
npx -y @fleox/agentphoto@0.1.
|
|
10
|
-
npx -y @fleox/agentphoto@0.1.
|
|
8
|
+
npx -y @fleox/agentphoto@0.1.1 doc apply --file recipe.json --dry-run --project my-photo --json
|
|
9
|
+
npx -y @fleox/agentphoto@0.1.1 doc apply --file recipe.json --yes --project my-photo --json
|
|
10
|
+
npx -y @fleox/agentphoto@0.1.1 render --project my-photo --compare --json
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
On an existing project, prefer adding the same layers and filters with `layer add` / `filter add` / `doc patch`: the user's other layers stay.
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "id": "product-white", "title": "Product on white", "description": "E-commerce square: product cut out (run remove_background on the photo layer), centred on a soft white backdrop with a contact shadow.", "category": "product", "tags": ["ecommerce", "packshot", "cutout", "white"], "width": 2000, "height": 2000, "slot": "photo" }
|
|
1
|
+
{ "id": "product-white", "title": "Product on white", "description": "E-commerce square: product cut out (run remove_background on the photo layer), centred on a soft white backdrop with a contact shadow. With your own photo, the first cut-out also scales and places the product on the floor shadow.", "category": "product", "tags": ["ecommerce", "packshot", "cutout", "white"], "width": 2000, "height": 2000, "slot": "photo", "subjectArea": { "x": 550, "y": 470, "width": 900, "height": 800, "anchor": "bottom" } }
|