---
name: image-subject-assets
description: Image processing and design asset generation. Use when given a single ordinary image and asked to extract the main subject, clean it to a transparent PNG, or adapt it into Apple platform assets such as Mac menu bar icons, app icons, Spotlight/Settings icons, App Store screenshots, iMessage icons, watchOS icons, tvOS icons, or in-app brand marks.
---

# Image Subject Assets

## Overview

Use this skill for one focused workflow: take one normal image, extract the main subject, raise it to a usable resolution, and return PNG assets.

Default behavior is generic output: return one transparent subject image.
Only generate iPhone-sized variants when the user clearly asks for iPhone, iOS buckets, or all iPhone screen sizes.
When the user describes an Apple product target in natural language, choose the matching Apple preset instead of asking them to remember dimensions or command-line flags.

Trigger this skill for requests like:

- “Extract the subject from this image.”
- “Create a transparent PNG.”
- “Cut out the person in this image and improve clarity.”
- “Adapt this image for all iPhone asset buckets.”
- “Create a Mac App menu bar icon.”
- “Generate iPhone Spotlight and Settings icons.”
- “Create Apple Watch, tvOS, or iMessage icon assets.”
- “Generate Mac App Store product-page image canvases.”

Chinese-language user requests are supported; map them by meaning to the same
English preset intents instead of relying on literal keyword matching.

## Quick Start

Run the script from the skill directory, or resolve the script path relative to this `SKILL.md` file.

Generic output:

```bash
uv run --with pillow --with numpy --with opencv-python --with 'rembg[cpu]' python \
  scripts/extract_subject_assets.py \
  --input /path/to/source.png \
  --output-dir /path/to/output \
  --basename Subject
```

Explicit iPhone output:

```bash
uv run --with pillow --with numpy --with opencv-python --with 'rembg[cpu]' python \
  scripts/extract_subject_assets.py \
  --input /path/to/source.png \
  --output-dir /path/to/output \
  --basename Subject \
  --target iphone
```

Apple preset output:

```bash
uv run --with pillow --with numpy --with opencv-python --with 'rembg[cpu]' python \
  scripts/extract_subject_assets.py \
  --input /path/to/source.png \
  --output-dir /path/to/output \
  --basename Subject \
  --preset mac-menu-bar-icon
```

Force the old OpenCV-only fallback when the local model is unavailable or when comparing results:

```bash
uv run --with pillow --with numpy --with opencv-python python \
  scripts/extract_subject_assets.py \
  --input /path/to/source.png \
  --output-dir /path/to/output \
  --basename Subject \
  --provider grabcut
```

## Output Contract

Default output writes one file:

- `SubjectTransparent.png`

When `--target iphone` is used, the script writes three additional transparent PNGs:

- `SubjectCompact@3x.png`
- `SubjectStandard@3x.png`
- `SubjectMax@3x.png`

iPhone canvas sizes are fixed:

- Compact: `1125×2001`
- Standard: `1170×2532`
- Max: `1290×2796`

When `--preset <name>` is used, the script writes the preset assets and an
`AssetReport.txt` file with canvas size, visible alpha bounds, and margins.
It does not write `SubjectTransparent.png` unless `--also-generic` is provided.

Common Apple presets:

- `mac-menu-bar-icon`: `22×22`, `44×44`, `66×66`; template-friendly transparent icon.
- `mac-brand-mark-square`: `44×44`, `88×88`, `132×132`; in-app header/settings logo.
- `apple-toolbar-symbol`: `16×16`, `32×32`, `48×48`; monochrome/template-friendly UI icon.
- `apple-app-icon-source`: `1024×1024`; modern iOS/iPadOS/macOS app icon source.
- `visionos-app-icon-source`: `1024×1024`; modern visionOS app icon source.
- `watchos-app-icon-source`: `1088×1088`; modern watchOS app icon source.
- `tvos-app-icon-source`: `800×480`; modern tvOS app icon source.
- `mac-app-iconset`: classic macOS `.appiconset` slots from `16×16` through `1024×1024`.
- `ios-ipados-iconset`: iOS/iPadOS notification, Settings, Spotlight, Home Screen, App Store slots.
- `watchos-iconset`: Apple Watch Home Screen, notification, and companion Settings slots.
- `imessage-iconset`: Messages App Store, drawer, breadcrumb, and bubble branding slots.
- `mac-app-store-screenshots`: `1280×800`, `1440×900`, `2560×1600`, `2880×1800`.
- `iphone-store-screenshots`: current iPhone App Store screenshot canvases, portrait and landscape.
- `ipad-store-screenshots`: current iPad App Store screenshot canvases, portrait and landscape.
- `apple-tv-store-screenshots`: `1920×1080`, `3840×2160`.
- `visionos-store-screenshot`: `3840×2160`.
- `watch-store-screenshots`: current Apple Watch App Store screenshot sizes.

For complete slot tables and natural-language routing, see
`references/apple-icon-presets.md`.

## Rules

- Keep the subject on a transparent background.
- For Apple app icons, iMessage icons, and App Store screenshots, prefer opaque output unless the user explicitly asks for transparent output; Apple app/icon slots generally should not contain transparent regions.
- Do not generate app mockups, previews, decorative backgrounds, or UI composites unless the user explicitly asks.
- If the user does not mention a target platform, return only the generic transparent PNG.
- If the user asks for an Apple target in plain language, map the request to a preset before running the script:
  - menu bar/status item/MenuBarExtra → `mac-menu-bar-icon`
  - home page/settings page/logo/brand mark → `mac-brand-mark-square`
  - toolbar/sidebar/template symbol → `apple-toolbar-symbol`
  - iOS/iPad/Mac app icon source → `apple-app-icon-source`
  - macOS `.appiconset`/Dock/Finder/Mac Spotlight explicit sizes → `mac-app-iconset`
  - iPhone/iPad Spotlight/Settings/Notification/full explicit iconset → `ios-ipados-iconset`
  - Apple Watch/watchOS iconset → `watchos-iconset`
  - tvOS app icon → `tvos-app-icon-source`
  - visionOS app icon → `visionos-app-icon-source`
  - iMessage/sticker icon → `imessage-iconset`
  - Mac App Store product page image/screenshot → `mac-app-store-screenshots`
  - iPhone App Store screenshot/product page image → `iphone-store-screenshots`
  - iPad App Store screenshot/product page image → `ipad-store-screenshots`
  - Apple TV App Store screenshot/product page image → `apple-tv-store-screenshots`
  - Apple Watch App Store screenshot/product page image → `watch-store-screenshots`
  - Vision Pro App Store screenshot/product page image → `visionos-store-screenshot`
- Default to `--provider auto`: try the local `rembg` model first, then fall back to the older OpenCV GrabCut extractor if the model is unavailable, errors, or returns an obviously bad alpha mask.
- Default local model is `isnet-general-use`, which is a practical quality-first local choice under the user's 1GB model-size budget. First run may download a local model cache; later runs reuse it.
- If disk space is extremely tight, `--rembg-model u2netp` uses a much smaller model but should be treated as lower quality.
- Use `--provider grabcut` only for fully offline/no-model runs or when comparing the old method.
- Use `--provider rembg` when the user explicitly wants the local model path to fail loudly instead of falling back.
- Add `--debug` when quality is questionable; it writes an alpha mask and checkerboard preview beside the final PNG.
- Prefer local upscaling when available. The script auto-detects `Upscayl`; otherwise it falls back to high-quality Lanczos resizing.
- Keep outputs minimal and avoid leaving extra files in the user workspace.
- Always read or summarize the preset asset report when producing Apple preset outputs. If a horizontal subject is placed in a square canvas, explain that top/bottom margins can be larger than left/right margins even when the visible width is correct.


---
Source attribution: SemiStack
Original project: https://github.com/SemiStack/agent-skills/blob/ba87236f4fdb404aa83821d433de3118961c2b54/skills/image-subject-assets/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2026 SemiStack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this skill and associated documentation files (the "Skill"), to deal
in the Skill without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Skill, and to permit persons to whom the Skill is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Skill.

THE SKILL IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SKILL OR THE USE OR OTHER DEALINGS IN THE
SKILL.



# Dave AI resource metadata

Creator / publisher: SemiStack
Original project: https://github.com/SemiStack/agent-skills/blob/ba87236f4fdb404aa83821d433de3118961c2b54/skills/image-subject-assets/SKILL.md
Attribution basis: Source repository record

Fields of work: Design
Roles: Graphic Designer, Product Designer, UX Designer
Specialties: Design
Tools: Numpy, Opencv Python, Pillow, Rembg
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: ddffca5d9693928580fedd6e7134d144ae8ac473770e6192e8b97f21263fa8c8
