diff --git a/packages/media/cpp/README.md b/packages/media/cpp/README.md index 2198eb49..d86df204 100644 --- a/packages/media/cpp/README.md +++ b/packages/media/cpp/README.md @@ -74,7 +74,7 @@ Registers a **PM-Media** cascading menu on image extensions (including **`.avif` Under `SystemFileAssociations`, each extension is registered as **`.ext`**, **`.EXT`**, and **`.Ext`** so Explorer picks up the menu regardless of filename casing. -Defaults: **`--media-bin`** = this executable; **`--explorer-script`** / **`--explorer-convert-script`** = `\\scripts\\explorer-*.ps1`, or `packages/media/scripts\\…` from a dev `cpp\\dist` build. +Defaults: **`--media-bin`** = this executable; **`--explorer-script`** / **`--explorer-convert-script`** / **`--explorer-ui-script`** = `\\scripts\\explorer-*.ps1`, or `packages/media/scripts\\…` from a dev `cpp\\dist` build. `pm-media register-explorer` forwards argv to `pm-image.exe` for convenience. @@ -109,7 +109,7 @@ Sharp wraps libvips: **decode → process → encode**. We do the same with `vip | `flip` / `flop` | `flip` / `flop` | | | Letterbox | `background` | `#rrggbb` for `contain` | -**Windows:** `pm-image resize --ui` opens a **native Win32** dialog to choose input/output paths, max dimensions, fit mode, quality, and enlargement / autorotate / strip options. Other CLI flags seed the dialog; **`--src` / `--dst` are not allowed** with `--ui`. If you cancel, the command exits without processing. +**Windows:** `pm-image resize --ui` opens a **native Win32** dialog to choose input/output paths, max dimensions, fit mode, quality, and enlargement / autorotate / strip options. Other CLI flags seed the dialog; if you cancel, the command exits without processing. `pm-image resize --ui-next` opens the newer **Win32++ ribbon UI** with drag-drop queue and settings panel; optional `--src` or positional input paths pre-seed the queue. **REST** `POST /v1/resize` accepts **`application/json`** (same keys as the table, plus **“Batch paths & cache”** below) **or** **`multipart/form-data`** (upload a file; response is the **image bytes** — see **`serve`**). **IPC** uses the same JSON keys as the table, plus the batch/cache fields. @@ -325,6 +325,28 @@ curl -s -X POST http://127.0.0.1:8080/v1/resize \ Optional JSON: `"cache":false`, `"expand_glob":false`, `"cache_dir":"..."` — see **Batch paths & cache** above. +### `transform` — AI image editing + +Uses a generative-AI model (currently **Google Gemini**) to edit an image based on a text prompt. Reads the input, sends image + prompt to the API, and writes the result. + +```bash +pm-image transform photo.jpg -p "remove the background" +pm-image transform photo.jpg out.png -p "make it black and white" --model gemini-3-pro-image-preview +``` + +| Flag | Default | Notes | +|------|---------|-------| +| `input` (positional) | **required** | Input image path | +| `output` (positional) | auto from input + prompt | Output path | +| `-p, --prompt` | **required** | Editing prompt | +| `--provider` | `google` | AI provider | +| `--model` | `gemini-3-pro-image-preview` | Model name | +| `--api-key` | env `IMAGE_TRANSFORM_GOOGLE_API_KEY` | API key | +| `--aspect-ratio` | auto | `1:1`, `16:9`, `4:3`, `3:4`, `9:16`, `21:9` | +| `--image-size` | `1K` | `512`, `1K`, `2K`, `4K` | + +If `--api-key` is omitted, the value of the **`IMAGE_TRANSFORM_GOOGLE_API_KEY`** environment variable is used. + ### `ipc` — one JSON line per connection (TCP; Unix socket on Linux/macOS) ```bash @@ -335,6 +357,14 @@ pm-image ipc --host 127.0.0.1 -p 9333 --cache-dir ./cache/images Same JSON fields as REST (`input`, `output`, globs, `expand_glob`, `cache`, `cache_dir`, resize options). +### `kbot` — forward to kbot + +Forwards remaining arguments to an external **kbot** binary. Set the **`KBOT_EXE`** environment variable to the kbot binary path (e.g. `packages/kbot/cpp/dist/kbot.exe`). + +```bash +KBOT_EXE=./kbot.exe pm-image kbot ai --prompt "hello" +``` + ## Tests From `packages/media/cpp`, after **`cmake --build --preset release`** (or `npm run build:release`): diff --git a/packages/media/cpp/docs/screenshot-v0.PNG b/packages/media/cpp/docs/screenshot-v0.PNG index 5c8430ca..44a40510 100644 Binary files a/packages/media/cpp/docs/screenshot-v0.PNG and b/packages/media/cpp/docs/screenshot-v0.PNG differ diff --git a/packages/media/cpp/ui-win32.md b/packages/media/cpp/ui-win32.md index e69de29b..73fe1807 100644 --- a/packages/media/cpp/ui-win32.md +++ b/packages/media/cpp/ui-win32.md @@ -0,0 +1,3 @@ +media\cpp\packages\Win32xx\samples\Picture\src + +media\cpp\packages\Win32xx\samples\ListView diff --git a/packages/media/cpp/v1.zip b/packages/media/cpp/v1.zip deleted file mode 100644 index 9dbfb7ff..00000000 Binary files a/packages/media/cpp/v1.zip and /dev/null differ