Repository navigation
Description
Context
OpenAI's edits endpoint accepts a markup annotation layer for GPT Image 2.5 and 2.6: a transparent PNG the same width and height as the first input image. Drawn strokes and notes guide the edit, and additional images are references. It cannot be combined with mask. Limits are 16,777,216 px for the first image and for the layer, and 50 MB for the layer file. There is no extra fee. Source: https://developers.openai.com/api/docs/guides/image-generation, checked 2026-11-09.
The module supports only --mask (ImageRequest.mask, packages/module-images/src/types.ts:30-31; multipart build, packages/module-images/src/providers/openai.ts:287-303).
Blocked by #3782
Scope
- Add
--markup <path>(PNG). It requires at least one--ref, is exclusive with--mask, and routes to OpenAI models that document markup (2.5 and 2.6 pairs). - Validate before any provider call: PNG signature, dimensions equal to the first
--ref(read from the PNG/JPEG/WebP header), pixel and byte limits. - Send it as the multipart
markupfile on/v1/images/edits. - Update help, README, skill and changeset.
Out of scope
The UI's mask-drawing tool (request_image_mask) and any UI for drawing markup. JSON-body edits with image_url/file_id.
Acceptance criteria
- An offline stub shows
--ref a.png --markup m.pngposts a multipartmarkuppart to/v1/images/editson the default model, with nomaskpart. - Markup without
--ref, with--mask, not a PNG, of mismatched dimensions, or on Gemini refuses with zero fetch calls. - Failing-first receipts and a restored mutation of the dimension check.
Verification
bun run test packages/module-images
bun run typecheck
bun run lint
bun run check:pr --base origin/mainKeyless and offline only.
Contract impact
The --json envelopes are unchanged. This is additive CLI behaviour, shipped as a minor changeset.
Activity
schlessera commentedon Nov 10, 2026
Unblocked: #3782 is closed, so
scripts/sync-project.tsis removing theblockedlabel.schlessera commentedon Nov 11, 2026
Claimed for implementation. Claim token:
claim-be93c819. Branch:feat/3785-image-markup.No path collisions; closure-only overlaps with open PRs touching shared test consumers.
schlessera commentedon Nov 11, 2026
The chat UI's markup editor, which would draw these layers, is tracked separately in #3975 (needs design).
test(module-images): compare markup bytes as arrays for strict typech…
schlessera commentedon Nov 11, 2026
Status: the implementation is complete in PR #3972, but it has not merged. Confirmation is blocked by a CI runner outage: the hosted runners cannot resolve the Ubuntu apt mirror (
Temporary failure resolving 'azure.archive.ubuntu.com') in the unit jobs' Chrome prerequisites step, so no test runs. The PR comment has the run IDs and evidence.Releasing my claim. To resume: once CI's prerequisite step passes again, merge
maininto the branch and runbun scripts/integrate.ts confirm 3972 --issues schlessera/brain-kit#3785. No code change is expected.schlessera commentedon Nov 12, 2026
Claimed for implementation. Claim token:
claim-50689fa2. Branch:feat/3785-image-markup.feat(module-images): markup-guided image edits with --markup (#3972)