@fleox/agentphoto 0.0.0-stage → 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/LICENSE +143 -0
- package/README.md +334 -2
- package/changelog.json +35 -0
- package/dist/agent/agentphoto.mjs +3354 -0
- package/dist/agent/chunks/assets-BZVUUHjg.mjs +151 -0
- package/dist/agent/chunks/catalog-DIZ5dnH5.mjs +953 -0
- package/dist/agent/chunks/context-CNpRboiC.mjs +75 -0
- package/dist/agent/chunks/doc-D_v_yE07.mjs +512 -0
- package/dist/agent/chunks/export-aNJcPNbJ.mjs +140 -0
- package/dist/agent/chunks/geometry-BKIhUO9x.mjs +315 -0
- package/dist/agent/chunks/ids-DAmiNwd9.mjs +28 -0
- package/dist/agent/chunks/imageInfo-QxAfu8R6.mjs +173 -0
- package/dist/agent/chunks/jsonPath-B7vAPXsi.mjs +155 -0
- package/dist/agent/chunks/library-C_EXiphj.mjs +16 -0
- package/dist/agent/chunks/models-CxrjmA0W.mjs +387 -0
- package/dist/agent/chunks/output-3F12IR9O.mjs +130 -0
- package/dist/agent/chunks/package-Cu1GyvKL.mjs +71 -0
- package/dist/agent/chunks/project-o1DH2nOw.mjs +200 -0
- package/dist/agent/chunks/rolldown-runtime-CMQPkI6i.mjs +18 -0
- package/dist/agent/chunks/server-I0trf5tM.mjs +241 -0
- package/dist/agent/chunks/templates-BJ2me4XZ.mjs +61 -0
- package/dist/agent/chunks/tools-DKaAPEV5.mjs +1419 -0
- package/dist/agent/chunks/tree-D8qZKPAb.mjs +127 -0
- package/dist/agent/chunks/types-DOK7tAAu.mjs +30 -0
- package/dist/agent/chunks/validate-CXPFB-i6.mjs +936 -0
- package/dist/engine/agentphoto-engine.js +2833 -0
- package/dist/engine/chunks/transformers.web-D5Vsg6-A.js +18494 -0
- package/dist/engine/ort/ort-wasm-simd-threaded.asyncify.mjs +124 -0
- package/dist/engine/ort/ort-wasm-simd-threaded.asyncify.wasm +0 -0
- package/dist/studio/assets/index-CmOzzoXv.css +1 -0
- package/dist/studio/assets/index-D3Iw5q8v.js +28 -0
- package/dist/studio/assets/transformers.web-osEqoMhg.js +38 -0
- package/dist/studio/index.html +15 -0
- package/dist/studio/library/LICENSES.md +57 -0
- package/dist/studio/library/fonts/OFL.txt +90 -0
- package/dist/studio/library/fonts/anton/anton-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/anton/anton-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/archivo-black/archivo-black-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/archivo-black/archivo-black-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/bebas-neue/bebas-neue-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/bebas-neue/bebas-neue-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/caveat/caveat-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/caveat/caveat-latin-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/caveat/caveat-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/caveat/caveat-latin-ext-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/dm-serif/dm-serif-display-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/dm-serif/dm-serif-display-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/inter/inter-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/inter/inter-latin-600-normal.woff2 +0 -0
- package/dist/studio/library/fonts/inter/inter-latin-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/inter/inter-latin-800-normal.woff2 +0 -0
- package/dist/studio/library/fonts/inter/inter-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/inter/inter-latin-ext-600-normal.woff2 +0 -0
- package/dist/studio/library/fonts/inter/inter-latin-ext-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/inter/inter-latin-ext-800-normal.woff2 +0 -0
- package/dist/studio/library/fonts/jetbrains-mono/jetbrains-mono-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/jetbrains-mono/jetbrains-mono-latin-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/jetbrains-mono/jetbrains-mono-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/jetbrains-mono/jetbrains-mono-latin-ext-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/lobster/lobster-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/lobster/lobster-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/montserrat/montserrat-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/montserrat/montserrat-latin-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/montserrat/montserrat-latin-800-normal.woff2 +0 -0
- package/dist/studio/library/fonts/montserrat/montserrat-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/montserrat/montserrat-latin-ext-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/montserrat/montserrat-latin-ext-800-normal.woff2 +0 -0
- package/dist/studio/library/fonts/oswald/oswald-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/oswald/oswald-latin-600-normal.woff2 +0 -0
- package/dist/studio/library/fonts/oswald/oswald-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/oswald/oswald-latin-ext-600-normal.woff2 +0 -0
- package/dist/studio/library/fonts/pacifico/pacifico-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/pacifico/pacifico-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/playfair/playfair-display-latin-400-italic.woff2 +0 -0
- package/dist/studio/library/fonts/playfair/playfair-display-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/playfair/playfair-display-latin-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/playfair/playfair-display-latin-ext-400-italic.woff2 +0 -0
- package/dist/studio/library/fonts/playfair/playfair-display-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/playfair/playfair-display-latin-ext-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/poppins/poppins-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/poppins/poppins-latin-600-normal.woff2 +0 -0
- package/dist/studio/library/fonts/poppins/poppins-latin-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/poppins/poppins-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/poppins/poppins-latin-ext-600-normal.woff2 +0 -0
- package/dist/studio/library/fonts/poppins/poppins-latin-ext-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/roboto-slab/LICENSE.txt +202 -0
- package/dist/studio/library/fonts/roboto-slab/roboto-slab-latin-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/roboto-slab/roboto-slab-latin-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/roboto-slab/roboto-slab-latin-ext-400-normal.woff2 +0 -0
- package/dist/studio/library/fonts/roboto-slab/roboto-slab-latin-ext-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/space-grotesk/space-grotesk-latin-500-normal.woff2 +0 -0
- package/dist/studio/library/fonts/space-grotesk/space-grotesk-latin-700-normal.woff2 +0 -0
- package/dist/studio/library/fonts/space-grotesk/space-grotesk-latin-ext-500-normal.woff2 +0 -0
- package/dist/studio/library/fonts/space-grotesk/space-grotesk-latin-ext-700-normal.woff2 +0 -0
- package/dist/studio/library/images/city.jpg +0 -0
- package/dist/studio/library/images/food.jpg +0 -0
- package/dist/studio/library/images/landscape.jpg +0 -0
- package/dist/studio/library/images/pet.jpg +0 -0
- package/dist/studio/library/images/portrait.jpg +0 -0
- package/dist/studio/library/images/product.jpg +0 -0
- package/dist/studio/library/index.json +752 -0
- package/dist/studio/templates/avatar-pro/assets/masks/photo-cutout.png +0 -0
- package/dist/studio/templates/avatar-pro/photo.json +13 -0
- package/dist/studio/templates/avatar-pro/preview.jpg +0 -0
- package/dist/studio/templates/avatar-pro/template.json +1 -0
- package/dist/studio/templates/index.json +1 -0
- package/dist/studio/templates/og-article/photo.json +13 -0
- package/dist/studio/templates/og-article/preview.jpg +0 -0
- package/dist/studio/templates/og-article/template.json +1 -0
- package/dist/studio/templates/polaroid/photo.json +13 -0
- package/dist/studio/templates/polaroid/preview.jpg +0 -0
- package/dist/studio/templates/polaroid/template.json +1 -0
- package/dist/studio/templates/product-white/assets/masks/photo-cutout.png +0 -0
- package/dist/studio/templates/product-white/photo.json +72 -0
- package/dist/studio/templates/product-white/preview.jpg +0 -0
- package/dist/studio/templates/product-white/template.json +1 -0
- package/dist/studio/templates/sale-banner/photo.json +125 -0
- package/dist/studio/templates/sale-banner/preview.jpg +0 -0
- package/dist/studio/templates/sale-banner/template.json +1 -0
- package/dist/studio/templates/social-quote/photo.json +13 -0
- package/dist/studio/templates/social-quote/preview.jpg +0 -0
- package/dist/studio/templates/social-quote/template.json +1 -0
- package/dist/studio/templates/story-promo/photo.json +13 -0
- package/dist/studio/templates/story-promo/preview.jpg +0 -0
- package/dist/studio/templates/story-promo/template.json +1 -0
- package/dist/studio/templates/youtube-thumbnail/photo.json +12 -0
- package/dist/studio/templates/youtube-thumbnail/preview.jpg +0 -0
- package/dist/studio/templates/youtube-thumbnail/template.json +1 -0
- package/library/LICENSES.md +57 -0
- package/library/fonts/OFL.txt +90 -0
- package/library/fonts/anton/anton-latin-400-normal.woff2 +0 -0
- package/library/fonts/anton/anton-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/archivo-black/archivo-black-latin-400-normal.woff2 +0 -0
- package/library/fonts/archivo-black/archivo-black-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/bebas-neue/bebas-neue-latin-400-normal.woff2 +0 -0
- package/library/fonts/bebas-neue/bebas-neue-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/caveat/caveat-latin-400-normal.woff2 +0 -0
- package/library/fonts/caveat/caveat-latin-700-normal.woff2 +0 -0
- package/library/fonts/caveat/caveat-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/caveat/caveat-latin-ext-700-normal.woff2 +0 -0
- package/library/fonts/dm-serif/dm-serif-display-latin-400-normal.woff2 +0 -0
- package/library/fonts/dm-serif/dm-serif-display-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/inter/inter-latin-400-normal.woff2 +0 -0
- package/library/fonts/inter/inter-latin-600-normal.woff2 +0 -0
- package/library/fonts/inter/inter-latin-700-normal.woff2 +0 -0
- package/library/fonts/inter/inter-latin-800-normal.woff2 +0 -0
- package/library/fonts/inter/inter-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/inter/inter-latin-ext-600-normal.woff2 +0 -0
- package/library/fonts/inter/inter-latin-ext-700-normal.woff2 +0 -0
- package/library/fonts/inter/inter-latin-ext-800-normal.woff2 +0 -0
- package/library/fonts/jetbrains-mono/jetbrains-mono-latin-400-normal.woff2 +0 -0
- package/library/fonts/jetbrains-mono/jetbrains-mono-latin-700-normal.woff2 +0 -0
- package/library/fonts/jetbrains-mono/jetbrains-mono-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/jetbrains-mono/jetbrains-mono-latin-ext-700-normal.woff2 +0 -0
- package/library/fonts/lobster/lobster-latin-400-normal.woff2 +0 -0
- package/library/fonts/lobster/lobster-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/montserrat/montserrat-latin-400-normal.woff2 +0 -0
- package/library/fonts/montserrat/montserrat-latin-700-normal.woff2 +0 -0
- package/library/fonts/montserrat/montserrat-latin-800-normal.woff2 +0 -0
- package/library/fonts/montserrat/montserrat-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/montserrat/montserrat-latin-ext-700-normal.woff2 +0 -0
- package/library/fonts/montserrat/montserrat-latin-ext-800-normal.woff2 +0 -0
- package/library/fonts/oswald/oswald-latin-400-normal.woff2 +0 -0
- package/library/fonts/oswald/oswald-latin-600-normal.woff2 +0 -0
- package/library/fonts/oswald/oswald-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/oswald/oswald-latin-ext-600-normal.woff2 +0 -0
- package/library/fonts/pacifico/pacifico-latin-400-normal.woff2 +0 -0
- package/library/fonts/pacifico/pacifico-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/playfair/playfair-display-latin-400-italic.woff2 +0 -0
- package/library/fonts/playfair/playfair-display-latin-400-normal.woff2 +0 -0
- package/library/fonts/playfair/playfair-display-latin-700-normal.woff2 +0 -0
- package/library/fonts/playfair/playfair-display-latin-ext-400-italic.woff2 +0 -0
- package/library/fonts/playfair/playfair-display-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/playfair/playfair-display-latin-ext-700-normal.woff2 +0 -0
- package/library/fonts/poppins/poppins-latin-400-normal.woff2 +0 -0
- package/library/fonts/poppins/poppins-latin-600-normal.woff2 +0 -0
- package/library/fonts/poppins/poppins-latin-700-normal.woff2 +0 -0
- package/library/fonts/poppins/poppins-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/poppins/poppins-latin-ext-600-normal.woff2 +0 -0
- package/library/fonts/poppins/poppins-latin-ext-700-normal.woff2 +0 -0
- package/library/fonts/roboto-slab/LICENSE.txt +202 -0
- package/library/fonts/roboto-slab/roboto-slab-latin-400-normal.woff2 +0 -0
- package/library/fonts/roboto-slab/roboto-slab-latin-700-normal.woff2 +0 -0
- package/library/fonts/roboto-slab/roboto-slab-latin-ext-400-normal.woff2 +0 -0
- package/library/fonts/roboto-slab/roboto-slab-latin-ext-700-normal.woff2 +0 -0
- package/library/fonts/space-grotesk/space-grotesk-latin-500-normal.woff2 +0 -0
- package/library/fonts/space-grotesk/space-grotesk-latin-700-normal.woff2 +0 -0
- package/library/fonts/space-grotesk/space-grotesk-latin-ext-500-normal.woff2 +0 -0
- package/library/fonts/space-grotesk/space-grotesk-latin-ext-700-normal.woff2 +0 -0
- package/library/images/city.jpg +0 -0
- package/library/images/food.jpg +0 -0
- package/library/images/landscape.jpg +0 -0
- package/library/images/pet.jpg +0 -0
- package/library/images/portrait.jpg +0 -0
- package/library/images/product.jpg +0 -0
- package/library/index.json +752 -0
- package/package.json +65 -4
- package/plugin/.claude-plugin/plugin.json +19 -0
- package/plugin/skills/agentphoto-cutout/SKILL.md +137 -0
- package/plugin/skills/agentphoto-design/SKILL.md +104 -0
- package/plugin/skills/agentphoto-design/references/layouts.md +60 -0
- package/plugin/skills/agentphoto-publish/SKILL.md +79 -0
- package/plugin/skills/agentphoto-retouch/SKILL.md +144 -0
- package/plugin/skills/agentphoto-retouch/references/filters.md +51 -0
- package/plugin/skills/agentphoto-retouch/references/patch-ops.md +67 -0
- package/plugin/skills/agentphoto-retouch/references/recipes.md +129 -0
- package/templates/avatar-pro/assets/masks/photo-cutout.png +0 -0
- package/templates/avatar-pro/photo.json +13 -0
- package/templates/avatar-pro/preview.jpg +0 -0
- package/templates/avatar-pro/template.json +1 -0
- package/templates/og-article/photo.json +13 -0
- package/templates/og-article/preview.jpg +0 -0
- package/templates/og-article/template.json +1 -0
- package/templates/polaroid/photo.json +13 -0
- package/templates/polaroid/preview.jpg +0 -0
- package/templates/polaroid/template.json +1 -0
- package/templates/product-white/assets/masks/photo-cutout.png +0 -0
- package/templates/product-white/photo.json +72 -0
- package/templates/product-white/preview.jpg +0 -0
- package/templates/product-white/template.json +1 -0
- package/templates/sale-banner/photo.json +125 -0
- package/templates/sale-banner/preview.jpg +0 -0
- package/templates/sale-banner/template.json +1 -0
- package/templates/social-quote/photo.json +13 -0
- package/templates/social-quote/preview.jpg +0 -0
- package/templates/social-quote/template.json +1 -0
- package/templates/story-promo/photo.json +13 -0
- package/templates/story-promo/preview.jpg +0 -0
- package/templates/story-promo/template.json +1 -0
- package/templates/youtube-thumbnail/photo.json +12 -0
- package/templates/youtube-thumbnail/preview.jpg +0 -0
- package/templates/youtube-thumbnail/template.json +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleox/agentphoto",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "The photo studio your AI agent can run: retouch, layers, masks, background removal, subject cutout, filters and looks as a non-destructive JSON document, previewed headless and exported as PNG / JPEG / WebP. With a Studio to finish by hand. No server, no account.",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"agentphoto": "dist/agent/agentphoto.mjs"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/agent",
|
|
15
|
+
"dist/engine",
|
|
16
|
+
"dist/studio",
|
|
17
|
+
"library",
|
|
18
|
+
"templates",
|
|
19
|
+
"plugin",
|
|
20
|
+
"changelog.json",
|
|
21
|
+
"README.md",
|
|
22
|
+
"LICENSE"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"dev": "vite",
|
|
26
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.agent.json",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"test:watch": "vitest",
|
|
29
|
+
"build:engine": "vite build --config vite.engine.config.ts",
|
|
30
|
+
"build:studio": "STUDIO_NO_ORT=1 vite build",
|
|
31
|
+
"build:studio:standalone": "vite build",
|
|
32
|
+
"build:agent": "vite build --config vite.agent.config.ts",
|
|
33
|
+
"build": "npm run build:engine && npm run build:studio && npm run build:agent && node scripts/write-version.mjs",
|
|
34
|
+
"check:skills": "node scripts/check-skills.mjs",
|
|
35
|
+
"docs:cli": "node scripts/build-cli-docs.mjs",
|
|
36
|
+
"check:docs": "node scripts/build-cli-docs.mjs --check",
|
|
37
|
+
"hermes:build": "node scripts/build-hermes.mjs",
|
|
38
|
+
"check:hermes": "node scripts/build-hermes.mjs --check && python3 -m unittest discover -s hermes/tests",
|
|
39
|
+
"version": "node scripts/sync-version.mjs && npm run build && node scripts/build-hermes.mjs && node scripts/build-cli-docs.mjs && git add -A plugin hermes .claude-plugin README.md AGENTS.md docs",
|
|
40
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build && npm run check:skills"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@huggingface/transformers": "^4.3.2",
|
|
44
|
+
"@types/node": "^26.6.6",
|
|
45
|
+
"@types/react": "^19.3.0",
|
|
46
|
+
"@types/react-dom": "^19.3.0",
|
|
47
|
+
"@vitejs/plugin-react": "^6.3.0",
|
|
48
|
+
"autoprefixer": "^10.7.0",
|
|
49
|
+
"clsx": "^2.1.1",
|
|
50
|
+
"happy-dom": "^21.0.4",
|
|
51
|
+
"lucide-react": "^1.78.0",
|
|
52
|
+
"postcss": "^8.5.33",
|
|
53
|
+
"react": "^19.3.1",
|
|
54
|
+
"react-dom": "^19.3.1",
|
|
55
|
+
"tailwindcss": "^3.4.19",
|
|
56
|
+
"typescript": "^7.0.2",
|
|
57
|
+
"vite": "^8.3.8",
|
|
58
|
+
"vitest": "^5.1.1"
|
|
59
|
+
},
|
|
60
|
+
"repository": {
|
|
61
|
+
"type": "git",
|
|
62
|
+
"url": "git+https://github.com/fleox/agentphoto.git"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agentphoto",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Skills to run AgentPhoto (the photo studio your AI agent can run): retouch photos (colour and light correction, looks, portrait retouch, crop and straighten), remove backgrounds and make masks with local AI, build social / marketing visuals from templates with text, shapes and layer effects, look at headless renders to check every change, and export PNG / JPEG / WebP in every size. Non-destructive JSON layer stack, nothing uploaded, no server, no account.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "fleox"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/fleox/agentphoto",
|
|
9
|
+
"repository": "https://github.com/fleox/agentphoto",
|
|
10
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"photo",
|
|
13
|
+
"image-editing",
|
|
14
|
+
"retouch",
|
|
15
|
+
"background-removal",
|
|
16
|
+
"design",
|
|
17
|
+
"mcp"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentphoto-cutout
|
|
3
|
+
description: Remove the background of a photo and work with masks in AgentPhoto, with local AI (nothing is uploaded) - cut out a person, a product or a pet, put it on white, a brand colour, a gradient or another photo, recentre and resize the subject, select an object with Segment Anything points or a box, select a colour range (sky, backdrop), invert, feather and refine edges by zooming the render, blur or recolour only the background, make transparent PNG stickers with an outline. Use when the user asks to remove or replace a background, cut out / isolate / extract a subject, make a packshot or product photo on white, a transparent PNG, a sticker, or a mask.
|
|
4
|
+
license: PolyForm-Noncommercial-1.0.0
|
|
5
|
+
compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge/Brave). AI models (25-170 MB) download once into ~/.cache/agentphoto/models.
|
|
6
|
+
metadata:
|
|
7
|
+
version: "0.1.1"
|
|
8
|
+
repository: "https://github.com/fleox/agentphoto"
|
|
9
|
+
allowed-tools: Bash Read Write
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Cut-outs and masks with AgentPhoto
|
|
13
|
+
|
|
14
|
+
Background removal and AI masks run **on this computer** in the user's Chrome (ONNX models via transformers.js). The photo is never uploaded. The first use of a model downloads it once (RMBG-1.4 168 MB, MODNet 25 MB, SlimSAM 30 MB) into `~/.cache/agentphoto/models`: tell the user it can take a minute the first time.
|
|
15
|
+
|
|
16
|
+
A cut-out is **non-destructive**: the AI writes a mask PNG to `assets/masks/` and sets it on the layer (white = keep). `mask clear` restores the original.
|
|
17
|
+
|
|
18
|
+
**Language:** talk to the user in their language; keep commands, ids and files in English.
|
|
19
|
+
|
|
20
|
+
Every command is `npx -y @fleox/agentphoto@0.1.1 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false. Basics (projects, render, filters): skill `agentphoto-retouch`.
|
|
21
|
+
|
|
22
|
+
## 1. Remove the background
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx -y @fleox/agentphoto@0.1.1 new my-photo --image ./photo.jpg --json
|
|
26
|
+
npx -y @fleox/agentphoto@0.1.1 remove-bg photo --project my-photo --json
|
|
27
|
+
npx -y @fleox/agentphoto@0.1.1 render --project my-photo --json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- Models: `rmbg-1.4` (default: products, people, animals, objects) or `--model modnet` (portraits only, soft hair). `models list` shows what is cached.
|
|
31
|
+
- `data.subject` is the kept area in canvas px `{ x, y, width, height }` (null = nothing found): use it to recentre, rescale and crop.
|
|
32
|
+
- Recentre and rescale the cut-out in one op: `fitLayer` scales the layer (uniformly) and moves it so `subject` fits `box` (canvas px), aligned on `anchor` (`center`, `bottom` = standing on a floor line, `top`, `left`…). Example on a 1600×900 canvas with a 10 % margin:
|
|
33
|
+
```bash
|
|
34
|
+
npx -y @fleox/agentphoto@0.1.1 doc patch --project my-photo --json '[{"op":"fitLayer","id":"photo","subject":{"x":881,"y":306,"width":475,"height":329},"box":{"x":160,"y":90,"width":1280,"height":720},"anchor":"center"}]'
|
|
35
|
+
```
|
|
36
|
+
Or let `remove-bg` do it: `--fit x,y,width,height --anchor bottom`. Scaling a small subject up a lot gives an `upscaled` warning in `check`: the source has too few pixels for that size.
|
|
37
|
+
- `--threshold 128` gives a hard edge (products with clean outlines); the default soft alpha is best for hair and fur. `--feather 2` softens a jagged edge.
|
|
38
|
+
- An empty canvas shows as transparent (white in the preview): export PNG or WebP to keep the transparency.
|
|
39
|
+
|
|
40
|
+
`remove-bg` is licensed differently per model: RMBG-1.4 is **non-commercial** (bria-rmbg-1.4 licence); for commercial work use `--model modnet` (Apache-2.0) on people, or SAM masks (`mask generate --method box`, Apache-2.0).
|
|
41
|
+
|
|
42
|
+
## 2. Replace the background
|
|
43
|
+
|
|
44
|
+
On a colour or gradient, with a soft drop shadow, in one command:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx -y @fleox/agentphoto@0.1.1 remove-bg photo --background "#ffffff" --shadow --project my-photo --json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
It adds a fill layer `photo-background` under the subject. Change it later like any layer:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx -y @fleox/agentphoto@0.1.1 layer update photo-background --set 'fill={"type":"radial","stops":["#ffffff","#e8edf3"]}' --project my-photo --json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
On another photo: import it as a layer and move it under the subject, then match the light (`temperature`, `exposure` on the subject) so it does not look pasted:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx -y @fleox/agentphoto@0.1.1 assets add ./beach.jpg --license proprietary --add-layer --layer-id backdrop --project my-photo --json
|
|
60
|
+
npx -y @fleox/agentphoto@0.1.1 layer move backdrop --below photo --project my-photo --json
|
|
61
|
+
npx -y @fleox/agentphoto@0.1.1 filter add backdrop --type blur --set radius=6 --project my-photo --json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
A slight blur on the new background sells the depth. The built-in CC0 photos (`assets library --kind image`) work as `"src": "library:<id>"`.
|
|
65
|
+
|
|
66
|
+
## 3. Product on white (packshot)
|
|
67
|
+
|
|
68
|
+
1. `remove-bg photo --background "#ffffff" --shadow --threshold 128` (clean edge).
|
|
69
|
+
2. Crop a square around `data.subject` with about 15 % margin on each side: side = max(width, height) / 0.7, centred on the subject. Example for `subject` = `{ "x": 881, "y": 306, "width": 475, "height": 329 }`:
|
|
70
|
+
```bash
|
|
71
|
+
npx -y @fleox/agentphoto@0.1.1 doc patch --project my-photo --json '[{"op":"crop","x":769,"y":121,"width":700,"height":700}]'
|
|
72
|
+
```
|
|
73
|
+
3. Tune the shadow so it reads as contact, not as a halo: `layer update photo --set effects.dropShadow.opacity=0.28 --set effects.dropShadow.distance=14 --set effects.dropShadow.blur=22`.
|
|
74
|
+
4. Render, zoom on the edges, `check`, then export at the size the shop wants (`export --format jpeg --width 2000`, skill `agentphoto-publish`). The template `product-white` (`new shop --template product-white --image ./mug.jpg`) gives a ready backdrop and floor shadow: run `remove-bg photo` on it — the first cut-out of your photo also scales the product and stands it on the floor shadow (`data.fitted` says where; `--fit none` keeps the layer where it is).
|
|
75
|
+
|
|
76
|
+
## 4. Check and refine the edge
|
|
77
|
+
|
|
78
|
+
Always zoom on difficult edges (hair, fur, fingers, transparent glass, the handle of a mug) at 1:1:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npx -y @fleox/agentphoto@0.1.1 render --project my-photo --zoom 420,220,200,200 --json
|
|
82
|
+
npx -y @fleox/agentphoto@0.1.1 render --project my-photo --layer photo --json
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
| What you see | Fix |
|
|
86
|
+
|---|---|
|
|
87
|
+
| Background left in a hole (inside a handle, between arms) | `mask generate photo --method points` with a `0` point in the hole, or `--threshold` |
|
|
88
|
+
| Part of the subject missing | `mask generate photo --method box` around the subject (Segment Anything), or `--model modnet` for people |
|
|
89
|
+
| Halo of the old background | `--threshold 160`, or a `feather` of 1..2, or a dark / light `stroke` effect hiding it |
|
|
90
|
+
| Hard, jagged edge | `remove-bg photo --feather 2` (soft alpha is the default) |
|
|
91
|
+
|
|
92
|
+
## 5. Masks from points, a box or a colour
|
|
93
|
+
|
|
94
|
+
`mask generate` makes a mask from pixels. Coordinates are **layer pixels** (from the layer's top-left, before rotation; for a full-canvas photo that is canvas px). `--target copy` duplicates the layer and masks the copy (the original stays whole), `--invert` keeps everything except the selection.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npx -y @fleox/agentphoto@0.1.1 mask generate photo --method points --points '[[700,420,1],[760,600,1],[1200,200,0]]' --target copy --copy-id subject --project my-photo --json
|
|
98
|
+
npx -y @fleox/agentphoto@0.1.1 mask generate photo --method box --box 400,200,1200,900 --target copy --copy-id boxed --project my-photo --json
|
|
99
|
+
npx -y @fleox/agentphoto@0.1.1 mask generate photo --method color --color "#579bd6" --tolerance 25 --target copy --copy-id sky --project my-photo --json
|
|
100
|
+
npx -y @fleox/agentphoto@0.1.1 mask generate photo --method subject --invert --feather 20 --target copy --copy-id bg --project my-photo --json
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Then change only that region with filters on the copy:
|
|
104
|
+
|
|
105
|
+
- **Background blur (portrait mode)**: the `bg` copy (subject inverted) + `filter add bg --type blur --set radius=14`.
|
|
106
|
+
- **Bluer sky**: the `sky` copy (colour range) + `filter add sky --type hueSaturation --set saturation=25 --set lightness=-10`.
|
|
107
|
+
- **Black-and-white background, colour subject**: the `bg` copy + `filter add bg --type grayscale`.
|
|
108
|
+
|
|
109
|
+
Pick colours for `--method color` from `analyze` (`dominant`). Points: `1` = include, `0` = exclude; three to five well-spread points beat one. Render the copy alone (`render --layer <copy-id>`) to judge the selection.
|
|
110
|
+
|
|
111
|
+
Hand-made masks (no AI) with `mask set`: an ellipse or rect with `feather` (vignette, spotlight), or a gradient (fade a photo into a panel):
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npx -y @fleox/agentphoto@0.1.1 mask set photo --mask '{"shape":"ellipse","x":200,"y":100,"width":1200,"height":860,"feather":120}' --project my-photo --json
|
|
115
|
+
npx -y @fleox/agentphoto@0.1.1 mask set photo --mask '{"gradient":{"type":"linear","angle":0,"stops":["black","white"]}}' --project my-photo --json
|
|
116
|
+
npx -y @fleox/agentphoto@0.1.1 mask clear photo --project my-photo --json
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
A mask object also takes `invert`, `feather` (px), `density` (0..1: how much it hides) and `enabled`. Shape and gradient masks on image / text / shape layers are in layer pixels.
|
|
120
|
+
|
|
121
|
+
## 6. Sticker (transparent PNG with an outline)
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npx -y @fleox/agentphoto@0.1.1 remove-bg photo --threshold 128 --project my-photo --json
|
|
125
|
+
npx -y @fleox/agentphoto@0.1.1 layer update photo --set effects.stroke.color=#ffffff --set effects.stroke.width=14 --set effects.dropShadow.opacity=0.35 --set effects.dropShadow.blur=12 --project my-photo --json
|
|
126
|
+
npx -y @fleox/agentphoto@0.1.1 export --project my-photo --format png --background transparent --json
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The stroke follows the mask's outline (`position`: outside by default). Crop around `data.subject` first so the sticker has no empty margin (leave room for the stroke: + 2 × width).
|
|
130
|
+
|
|
131
|
+
## Rules
|
|
132
|
+
|
|
133
|
+
- Render and look after every mask: an AI mask is a guess. Zoom on the edges before saying it is done.
|
|
134
|
+
- Masks are files in `assets/masks/`; never edit or delete them by hand (`assets list` shows which layer uses each).
|
|
135
|
+
- Re-running `remove-bg` or `mask generate` on the same layer replaces its mask; the old PNG stays in `assets/masks/`.
|
|
136
|
+
- Keep the photo's original pixels: never "bake" a cut-out; the user can always `mask clear`.
|
|
137
|
+
- JPEG has no transparency: transparent results go out as PNG or WebP.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentphoto-design
|
|
3
|
+
description: Design social media and marketing visuals with AgentPhoto - YouTube thumbnails, Open Graph / link previews, Instagram posts and stories, Pinterest pins, web and LinkedIn banners, sale ads, quote posts, avatars and product cards - from templates or a blank canvas at the right size preset, with the user's photo, bundled fonts, text with effects, shapes, gradients and cut-out subjects, following layout rules (safe margins, contrast, hierarchy), checked on headless renders and exported in several formats at once. Use when the user wants a thumbnail, banner, post, story, cover, ad, flyer, card or any visual combining a photo with text.
|
|
4
|
+
license: PolyForm-Noncommercial-1.0.0
|
|
5
|
+
compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge/Brave) for renders.
|
|
6
|
+
metadata:
|
|
7
|
+
version: "0.1.1"
|
|
8
|
+
repository: "https://github.com/fleox/agentphoto"
|
|
9
|
+
allowed-tools: Bash Read Write
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Design visuals with AgentPhoto
|
|
13
|
+
|
|
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
|
+
|
|
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
|
+
|
|
18
|
+
## 1. Brief
|
|
19
|
+
|
|
20
|
+
Get, or decide and say: the **format** (where it will be posted), the **message** (a title of 2 to 6 words, optional subtitle / call to action), the **photo** (the user's file, or a built-in sample) and the **brand** (colours, font mood). Do not ask more than two questions; propose defaults.
|
|
21
|
+
|
|
22
|
+
## 2. Start from a template (fastest)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
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
|
+
```
|
|
30
|
+
|
|
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.
|
|
32
|
+
|
|
33
|
+
Then make it the user's:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
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
|
+
```
|
|
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. 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
|
+
|
|
44
|
+
## 3. Or start from a size preset
|
|
45
|
+
|
|
46
|
+
```bash
|
|
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
|
+
```
|
|
57
|
+
|
|
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
|
+
|
|
60
|
+
## 4. Typography
|
|
61
|
+
|
|
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
|
+
|
|
64
|
+
| Mood | Title font | Body / small text |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| YouTube, sport, impact | `bebas-neue`, `anton`, `archivo-black` | `montserrat` 800, `poppins` 700 |
|
|
67
|
+
| Clean tech / SaaS | `inter` 800, `space-grotesk` 700 | `inter` 400..600 |
|
|
68
|
+
| Editorial, luxury, quotes | `playfair` 700, `dm-serif` | `inter`, `montserrat` |
|
|
69
|
+
| Friendly, food, kids | `poppins` 700, `lobster`, `pacifico` | `poppins` 400 |
|
|
70
|
+
| Handwritten caption | `caveat` 700 | — |
|
|
71
|
+
| Poster, label | `roboto-slab` 700, `oswald` 600 | `oswald` 400 |
|
|
72
|
+
|
|
73
|
+
Text fields: `size` (px), `weight` (only the weights the font has), `width` (wraps, needed for multi-line), `align`, `lineHeight` (0.95..1.1 for big titles), `letterSpacing` (2..6 for small caps labels), `transform: "uppercase"`, `color` (colour or gradient), `background` `{ "color", "padding": [h, v], "radius" }` for a label / pill. Use `\n` in `text` for chosen line breaks: in `--set`, write the value as a JSON string so `\n` becomes a line break (`--set 'text="Line one\nline two"'`); unquoted, it stays a literal backslash-n.
|
|
74
|
+
|
|
75
|
+
Effects that keep text readable on photos: `stroke` (`{ "color": "#12082e", "width": 8 }` on thumbnails), `dropShadow` (`{ "opacity": 0.4, "blur": 18 }`), or a gradient fill layer / shape behind the text.
|
|
76
|
+
|
|
77
|
+
## 5. Layout rules
|
|
78
|
+
|
|
79
|
+
- **Safe margins**: keep text and faces at least 5 % of the canvas from every edge (64 px on 1280 wide). Stories: keep the top 250 px and bottom 300 px of 1920 free of important text (app UI covers them). YouTube: the bottom-right corner holds the video duration.
|
|
80
|
+
- **Hierarchy**: one dominant title (big, heavy), one secondary line at most a third of its size, one accent colour. Max 3 text layers on a thumbnail, 6 words in the title.
|
|
81
|
+
- **Contrast**: light text on dark areas or the reverse; on a busy photo add a gradient fill layer (`rgba(0,0,0,0)` → `rgba(0,0,0,0.6)`) or a stroke. Check on the render that every letter is readable.
|
|
82
|
+
- **Faces and subjects** on the opposite side from the text, looking towards it when possible; never crop through eyes or chins.
|
|
83
|
+
- **Thumbnail test**: the visual must still read at small size. Render a small preview and look:
|
|
84
|
+
```bash
|
|
85
|
+
npx -y @fleox/agentphoto@0.1.1 render --project thumb --max-width 320 --json
|
|
86
|
+
```
|
|
87
|
+
- **Brand colours**: reuse the user's hex values exactly; derive dark / light tints for backgrounds rather than adding new hues.
|
|
88
|
+
|
|
89
|
+
More layouts (composition grids per format, colour pairs, badge and pill recipes): [references/layouts.md](references/layouts.md).
|
|
90
|
+
|
|
91
|
+
## 6. Check and deliver
|
|
92
|
+
|
|
93
|
+
```bash
|
|
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
|
+
```
|
|
97
|
+
|
|
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.
|
|
99
|
+
|
|
100
|
+
## Rules
|
|
101
|
+
|
|
102
|
+
- Render after every visual change and look at the whole picture and at the small version.
|
|
103
|
+
- Keep ids stable (`title`, `photo`…): patches and the Studio refer to them.
|
|
104
|
+
- Licences: the user's photos are theirs; built-in samples are CC0; bundled fonts are OFL / Apache-2.0 and need no credit in images. `check` lists `licences` that need attribution.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Layouts per format
|
|
2
|
+
|
|
3
|
+
Coordinates are canvas pixels (origin top-left). Each grid below is what the matching template uses; start from the template (`templates show <id>`) when one fits, and adapt sizes to the text length (check the render).
|
|
4
|
+
|
|
5
|
+
## YouTube thumbnail — 1280×720 (`youtube-thumbnail`)
|
|
6
|
+
|
|
7
|
+
- Subject cut out on the right half (`x` 700, box 560×660), white `stroke` 10 + `dropShadow` so it pops off the background.
|
|
8
|
+
- Title on the left: `bebas-neue` 130..160 px, `lineHeight` 0.95, 2 lines max, `width` ≈ 680, dark `stroke` 8.
|
|
9
|
+
- One label pill (`montserrat` 800, 40..48 px, `background` with `padding: [18, 10]`, `radius` 8, slight `rotation` -3).
|
|
10
|
+
- Background: a saturated 2..3 stop gradient; a soft radial glow behind the head.
|
|
11
|
+
- Keep the bottom-right 200×60 free (video duration).
|
|
12
|
+
|
|
13
|
+
## Link preview / Open Graph — 1200×630 (`og-article`)
|
|
14
|
+
|
|
15
|
+
- Text panel on the left 55 %, photo on the right fading in with a gradient mask `{"gradient":{"type":"linear","angle":0,"stops":["black","white"]}}`.
|
|
16
|
+
- Kicker (small caps, `letterSpacing` 3..4, accent colour) above a 56..72 px title, 3 lines max, `width` ≤ 600.
|
|
17
|
+
- Site name at the bottom-left, 22..26 px. Platforms crop the edges slightly: keep 48 px margins.
|
|
18
|
+
|
|
19
|
+
## Square post — 1080×1080 (`social-quote`)
|
|
20
|
+
|
|
21
|
+
- Full-bleed photo (`fit: "cover"`), darkened with a fill layer or `brightnessContrast`, a little `blur` for a quote background.
|
|
22
|
+
- Centred or left-aligned text block within an 880 px column; quote 64..80 px `playfair`, author 30..34 px.
|
|
23
|
+
|
|
24
|
+
## Story / Reel — 1080×1920 (`story-promo`)
|
|
25
|
+
|
|
26
|
+
- Full-bleed photo, dark gradient fill on the bottom 45 % for the text.
|
|
27
|
+
- Title 120..160 px between y ≈ 1200 and 1550; a call-to-action pill (`background` radius = half its height) under it.
|
|
28
|
+
- Nothing important above y 250 or below y 1620 (app UI).
|
|
29
|
+
|
|
30
|
+
## Web banner — 1920×600 (`sale-banner`); LinkedIn banner — 1584×396
|
|
31
|
+
|
|
32
|
+
- Text on the left third, photo on the right fading in, a starburst badge (`shape: "star"`, `sides` 12..16, `innerRadius` 0.8) for a discount.
|
|
33
|
+
- LinkedIn: the profile picture covers the bottom-left (≈ 0..400 × 200..396 on desktop): keep text on the right two thirds.
|
|
34
|
+
|
|
35
|
+
## Product card — 2000×2000 (`product-white`)
|
|
36
|
+
|
|
37
|
+
- Cut-out product centred, filling 65..75 % of the width, contact shadow ellipse under it (`rgba(0,0,0,0.28)`, `blur` filter), soft off-white backdrop.
|
|
38
|
+
|
|
39
|
+
## Colour pairs that read well
|
|
40
|
+
|
|
41
|
+
| Background | Text | Accent |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `#0f172a` (slate) | `#f8fafc` | `#38bdf8` |
|
|
44
|
+
| `#12082e` → `#ff4f81` (gradient) | `#ffffff` with `#12082e` stroke | `#ffd166` |
|
|
45
|
+
| `#fff7ed` (cream) | `#1c1917` | `#ea580c` |
|
|
46
|
+
| `#052e16` (forest) | `#ecfdf5` | `#a3e635` |
|
|
47
|
+
| `#111111` | `#ffffff` | brand colour |
|
|
48
|
+
|
|
49
|
+
## Badges and pills
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{ "id": "pill", "type": "text", "text": "Shop now", "x": 64, "y": 470, "font": "poppins", "weight": 700, "size": 34, "color": "#ffffff",
|
|
53
|
+
"background": { "color": "#111827", "padding": [28, 14], "radius": 40 } }
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{ "id": "badge", "type": "shape", "shape": "star", "x": 1580, "y": 60, "width": 240, "height": 240, "sides": 14, "innerRadius": 0.82, "fill": "#3b0a14", "rotation": 12 }
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Add them with `layer add --layer '<json>'`, then a text layer centred on the badge (`width` = the badge width, `align: "center"`).
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentphoto-publish
|
|
3
|
+
description: Export and deliver AgentPhoto images - run the pre-export check, pick the format (PNG, JPEG, WebP; transparency), quality and size (presets for Open Graph, Instagram, stories, YouTube, Pinterest, banners, or exact width / height / scale, cover or contain), export several variants at once, keep files light for the web, name and place outputs, and open the Studio so the user can finish by hand. Use when the user wants to save, export, download, resize for a platform, compress or optimise an image made with AgentPhoto, needs several sizes, or wants to edit it visually themselves.
|
|
4
|
+
license: PolyForm-Noncommercial-1.0.0
|
|
5
|
+
compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge/Brave) for exports and the Studio.
|
|
6
|
+
metadata:
|
|
7
|
+
version: "0.1.1"
|
|
8
|
+
repository: "https://github.com/fleox/agentphoto"
|
|
9
|
+
allowed-tools: Bash Read Write
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Export and share with AgentPhoto
|
|
13
|
+
|
|
14
|
+
**Language:** talk to the user in their language; keep commands, ids and files in English.
|
|
15
|
+
|
|
16
|
+
Every command is `npx -y @fleox/agentphoto@0.1.1 <command> --json` with `--project <dir>`. Read `error.hint` when `ok` is false.
|
|
17
|
+
|
|
18
|
+
## 1. Check first
|
|
19
|
+
|
|
20
|
+
```bash
|
|
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
|
+
```
|
|
24
|
+
|
|
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.
|
|
26
|
+
|
|
27
|
+
## 2. Export
|
|
28
|
+
|
|
29
|
+
```bash
|
|
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
|
+
```
|
|
34
|
+
|
|
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`.
|
|
36
|
+
|
|
37
|
+
| Need | Format |
|
|
38
|
+
|---|---|
|
|
39
|
+
| Photo for the web, smallest file | `--format webp --quality 80` (≈ 30–50 % smaller than JPEG) |
|
|
40
|
+
| Photo for email, print shops, any app | `--format jpeg --quality 85..90` |
|
|
41
|
+
| Transparency (cut-out, sticker, logo), flat graphics, text-heavy | `--format png` (or `webp`, which keeps alpha) |
|
|
42
|
+
| Social networks | JPEG at the platform preset; they re-compress anyway |
|
|
43
|
+
|
|
44
|
+
JPEG has no alpha: transparent areas are flattened on white, or on `--background "#0f172a"`. `--background transparent` keeps alpha in PNG / WebP. `avif` is accepted, but Chrome's canvas cannot encode it: the file is written as PNG with a `note` in the result; use WebP.
|
|
45
|
+
|
|
46
|
+
## 3. Sizes and variants
|
|
47
|
+
|
|
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
|
+
|
|
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
|
+
|
|
52
|
+
```bash
|
|
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
|
+
```
|
|
55
|
+
|
|
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`.
|
|
57
|
+
|
|
58
|
+
## 4. Light files for the web
|
|
59
|
+
|
|
60
|
+
- Width: export at the size it is displayed, ×2 for retina at most (a 800 px wide blog image → `--width 1600`). Never upscale beyond the canvas for the web.
|
|
61
|
+
- Targets: hero image < 250 KB, in-article photo < 150 KB, thumbnail < 60 KB, Open Graph < 300 KB (platforms reject > 5 MB).
|
|
62
|
+
- Too heavy: lower `--quality` by 5–10 (WebP 75..82 still looks clean), reduce the width, or switch PNG photos to WebP / JPEG. Re-export with `--yes` and compare `kb`.
|
|
63
|
+
- Add a `description` to the document (alt text) for accessibility: `doc patch` `[{"op":"set","path":"description","value":"…"}]`.
|
|
64
|
+
|
|
65
|
+
## 5. The Studio: let the user finish by hand
|
|
66
|
+
|
|
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
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx -y @fleox/agentphoto@0.1.1 studio --project my-photo --json
|
|
71
|
+
```
|
|
72
|
+
|
|
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/`).
|
|
74
|
+
|
|
75
|
+
## Rules
|
|
76
|
+
|
|
77
|
+
- Never overwrite exports without the user's agreement (`needsConfirmation` → ask → `--yes`).
|
|
78
|
+
- Report what was written: paths, pixel sizes, KB; offer the other sizes they may need.
|
|
79
|
+
- The images stay on the user's computer: AgentPhoto never uploads anything. Publishing them (site, social network) is the user's step, or another tool's.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentphoto-retouch
|
|
3
|
+
description: Retouch a photo with AgentPhoto - open the user's photo as a non-destructive project, measure it (analyze), fix light and colour (exposure, levels, curves, white balance, shadows / highlights, vibrance), apply looks (film, cinema, B&W, golden hour...), retouch portraits (skin smoothing masked to the face, clarity, eyes), crop / straighten / resize, add text, shapes and layer effects, then render and LOOK at the result, check and export. Use when the user wants to edit, enhance, correct, grade, crop or retouch a photo or image file, or change an existing AgentPhoto project (photo.json).
|
|
4
|
+
license: PolyForm-Noncommercial-1.0.0
|
|
5
|
+
compatibility: Requires Node.js 22+ and Google Chrome (or Chromium/Edge/Brave) for renders and AI masks.
|
|
6
|
+
metadata:
|
|
7
|
+
version: "0.1.1"
|
|
8
|
+
repository: "https://github.com/fleox/agentphoto"
|
|
9
|
+
allowed-tools: Bash Read Write
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Retouch a photo with AgentPhoto
|
|
13
|
+
|
|
14
|
+
A project is a folder: `photo.json` (the document: a stack of layers, bottom to top), `assets/` (imported photos, AI masks), `renders/` (previews) and `dist/` (exports). Every edit is data in `photo.json`: the source photo is never modified, every filter can be changed or removed later.
|
|
15
|
+
|
|
16
|
+
**Language:** talk to the user in their language; keep commands, ids and files in English.
|
|
17
|
+
|
|
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
|
+
|
|
20
|
+
## 1. Open the photo
|
|
21
|
+
|
|
22
|
+
```bash
|
|
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
|
+
```
|
|
26
|
+
|
|
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
|
+
|
|
29
|
+
```bash
|
|
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
|
+
```
|
|
34
|
+
|
|
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.
|
|
36
|
+
|
|
37
|
+
`analyze` returns brightness (0..255), contrast, tonal `range`, `clippedShadows` / `clippedHighlights` (%), `saturation`, `cast` (`warm` > 0 = orange, < 0 = blue; `magenta`), `sharpness`, dominant colours and `suggestions` (filters ready to apply). Suggestions are measurements, not orders: a blue lake or a sunset is not a colour cast. Confirm with your eyes.
|
|
38
|
+
|
|
39
|
+
## 2. Light and colour
|
|
40
|
+
|
|
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
|
+
|
|
43
|
+
```bash
|
|
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
|
+
```
|
|
47
|
+
|
|
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
|
+
|
|
50
|
+
```bash
|
|
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
|
+
```
|
|
55
|
+
|
|
56
|
+
| Problem (what you see / what analyze says) | Filter (real parameters) |
|
|
57
|
+
|---|---|
|
|
58
|
+
| Too dark / too bright overall | `{"type":"exposure","exposure":0.3}` (stops, -5..5) |
|
|
59
|
+
| Flat, hazy (`range` far from 0..255) | `{"type":"levels","black":20,"white":235}` or `{"type":"autoContrast"}` |
|
|
60
|
+
| Needs punch in the midtones | `{"type":"curves","rgb":[[0,0],[64,54],[192,204],[255,255]]}` (gentle S) |
|
|
61
|
+
| Backlit face, dark shadows, blown sky | `{"type":"shadowsHighlights","shadows":30,"highlights":25}` |
|
|
62
|
+
| Orange / blue cast | `{"type":"temperature","temperature":-12}` (negative = cooler), `tint` for green / magenta |
|
|
63
|
+
| Dull colours (`saturation` < 20) | `{"type":"vibrance","vibrance":25}` (skin-safe), `hueSaturation` for strong changes |
|
|
64
|
+
| Soft | `{"type":"sharpen","amount":60,"radius":1,"threshold":4}` on the photo layer |
|
|
65
|
+
| Lacks texture / depth | `{"type":"clarity","amount":15}` |
|
|
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.1 catalog filters --json`, one filter: `catalog filters curves`. Cheat-sheet: [references/filters.md](references/filters.md).
|
|
68
|
+
|
|
69
|
+
Keep corrections moderate: one strong change looks edited. Stop when the render looks natural.
|
|
70
|
+
|
|
71
|
+
## 3. Looks
|
|
72
|
+
|
|
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
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npx -y @fleox/agentphoto@0.1.1 filter add correct --filter '{"type":"look","look":"film","amount":0.6}' --project my-photo --json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Offering options: render each candidate (`filter update correct <index> --set look='"cinema"'`), show the user the images, keep the one they choose.
|
|
80
|
+
|
|
81
|
+
## 4. Portrait retouch
|
|
82
|
+
|
|
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
|
+
```bash
|
|
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
|
+
```
|
|
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
|
+
2. Smooth the copy only (edge-preserving, keeps pores visible at amount < 1):
|
|
90
|
+
```bash
|
|
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
|
+
```
|
|
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
|
+
4. Zoom on the face at 1:1 and look: plastic skin means a lower `amount` or `radius`.
|
|
95
|
+
```bash
|
|
96
|
+
npx -y @fleox/agentphoto@0.1.1 render --project my-photo --zoom 560,300,480,480 --json
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Never change a face's shape, skin tone or identity beyond what the user asked.
|
|
100
|
+
|
|
101
|
+
## 5. Crop, straighten, resize
|
|
102
|
+
|
|
103
|
+
Geometry ops move every layer so the picture stays the same (nothing is rasterised). Straighten first, then crop, then resize:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
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
|
+
```
|
|
110
|
+
|
|
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.
|
|
112
|
+
- Crop is in canvas pixels; `resizeImage` scales the whole document (`width`, `height` or `scale`). Other ops: `resizeCanvas` (`width`, `height`, `anchor`: center, top-left…), `rotateCanvas` (`angle` 90 / 180 / 270), `flipCanvas` (`axis` horizontal / vertical).
|
|
113
|
+
- A social format is often better done at export (`--preset square --fit cover`, skill `agentphoto-publish`).
|
|
114
|
+
|
|
115
|
+
All patch ops, paths and shortcuts: [references/patch-ops.md](references/patch-ops.md).
|
|
116
|
+
|
|
117
|
+
## 6. Text, shapes, effects
|
|
118
|
+
|
|
119
|
+
```bash
|
|
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
|
+
```
|
|
124
|
+
|
|
125
|
+
Fonts are bundled (`catalog fonts`); effects: `dropShadow`, `outerGlow`, `innerShadow`, `stroke`, `colorOverlay` (`catalog effects`). Layout rules and typography: skill `agentphoto-design`.
|
|
126
|
+
|
|
127
|
+
## 7. Check and export
|
|
128
|
+
|
|
129
|
+
```bash
|
|
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
|
+
```
|
|
133
|
+
|
|
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`.
|
|
135
|
+
|
|
136
|
+
Complete, validated documents for common jobs (colour correction, portrait, B&W, background blur, caption): [references/recipes.md](references/recipes.md).
|
|
137
|
+
|
|
138
|
+
## Rules
|
|
139
|
+
|
|
140
|
+
- Render and look after every visual change; describe what you see, not what you hoped.
|
|
141
|
+
- Prefer adjustment layers and filters over anything destructive; never edit `assets/` files by hand.
|
|
142
|
+
- Plans with `needsConfirmation: true` wrote nothing: tell the user what will be removed or overwritten, and re-run with `--yes` only after they agree.
|
|
143
|
+
- Patches are atomic and validated: on `ok: false` nothing was written. Read the error's `hint` ("did you mean") and fix the op.
|
|
144
|
+
- The user's photos stay on their computer: AgentPhoto uploads nothing. AI models download once (tell the user the first cut-out can take a minute).
|