Brand Asset Generator
Generate a reusable image asset package from one logo, mark, or icon source image.
Workflow
- Confirm the source image path and intended output target.
- If the user wants integration into an existing app, inspect the project first and identify the expected public/static/icon paths.
- Generate assets into
brand/<name>/ under the target project root, or into <output-dir>/<name>/ when requested.
- Copy generated files into app paths only when the user asks for integration or the project clearly already has matching icon paths.
- Verify generated dimensions, transparency/background behavior, and any copied project references.
Use When
- The user provides a source image and wants project-ready brand or logo assets.
- The user needs transparent app/web source marks with different padding.
- The user needs favicon, PWA, apple touch, desktop app, tray,
.ico, or .icns outputs.
- The user wants a configurable background color for outputs that should not stay transparent.
- The user wants generated assets placed into an existing web, PWA, Electron, Tauri, or desktop-app project.
Do Not Use
- Do not use for designing a new logo from scratch.
- Do not assume project-specific output paths before inspecting the target project.
- Do not copy generated files into application folders unless the user asks for integration or matching paths already exist.
- Do not add image-processing dependencies to the target project just to run this local generator.
Required Inputs
Require:
--input <file>: source image path.
Use --name <name> when the source marks need a stable prefix. If omitted, derive it from the input filename.
By default, assets are written to brand/<name>/ under the current working directory. Use --output-dir <dir> only when the user wants to override the output parent directory.
Script
Run the bundled script:
python3 <skill-dir>/scripts/generate_brand_assets.py \
--input path/to/source.png \
--name brand \
--profile all \
--background "#ffffff"
Options:
--profile source|web|desktop|all: choose the output group; default is all.
--output-dir <dir>: override the default output parent directory; assets are written to <dir>/<name>/.
--background "#rrggbb": default background for non-transparent outputs; default is #ffffff.
--web-fill <0..1>: visible subject scale for web source mark; default is 0.86.
--app-fill <0..1>: visible subject scale for app/desktop source mark; default is 0.68.
--favicon-corner-radius <0..0.5>: rounded background radius ratio for favicon outputs; default is 0.18.
--web-corner-radius <0..0.5>: rounded background radius ratio for regular PWA web icons; default is 0.22.
--favicon-container-inset <0..0.4>: override transparent outer inset for favicon PNG outputs; default is per-size.
--web-container-inset <0..0.4>: transparent outer inset for regular PWA web icons; default is 0.08.
--line-width-ratio <0..0.2>: outline thickness for fill-derived line source marks; default is 0.035.
--background-threshold <n>: RGB edge-background removal tolerance; default is 28.
--force-background: apply background to all generated PNG and ICO/ICNS outputs.
--transparent-background: keep outputs transparent even when they normally get the default background.
If Pillow is missing, install it in the active Python environment:
python3 -m pip install --user pillow
Project Placement
When integrating generated assets into a project, prefer existing conventions over new paths:
- Web/static apps: place favicons and PWA icons in the configured public/static root, commonly
public/, static/, or app-specific asset folders.
- Next.js/App Router: check
app/icon.*, app/apple-icon.*, public/, and metadata config before adding files.
- Vite/React/Vue/Svelte apps: check
public/, index.html, and any manifest file before replacing favicons.
- PWA projects: update the existing
manifest.json or site.webmanifest only when icon paths need to change.
- Electron/Tauri/desktop projects: check the builder config for icon paths before copying
desktop/icon.* or tray images.
If there is no existing convention and the user did not request direct integration, report the generated output directory instead of choosing an app path.
Output Contract
The script writes a folder under brand/ named from --name or the input filename slug. For example, --name sample-brand writes:
brand/
sample-brand/
source/
sample-brand-mark-app.png
sample-brand-mark-web.png
sample-brand-mark-app-line.png # only when the input source is detected as fill
sample-brand-mark-web-line.png # only when the input source is detected as fill
web/
favicon-16x16.png
favicon-32x32.png
favicon-48x48.png
favicon.png
favicon.ico
icon-192.png
icon-512.png
icon-192-maskable.png
icon-512-maskable.png
apple-touch-icon.png
desktop/
icon.icns
icon.ico
icon.png
icons/
16x16.png
24x24.png
32x32.png
48x48.png
64x64.png
96x96.png
128x128.png
256x256.png
512x512.png
1024x1024.png
tray.ico
tray.png
trayTemplate.png
trayTemplate@2x.png
preview.png
When --output-dir <dir> is provided, the same source/, web/, desktop/, and preview.png structure is written under <dir>/<name>/.
Generation Rules
- Remove only the edge-connected background for RGB sources; keep same-colored interior details.
- Preserve existing alpha when the input already has transparency.
- Write source marks as 512x512 RGBA transparent PNGs.
- When the source subject is detected as a fill mark, also write 512x512 RGBA transparent line variants as
mark-app-line and mark-web-line.
- Control fill-derived line thickness with
--line-width-ratio; the value is multiplied by the cropped source subject's largest side.
- Do not create fill variants for line-mark inputs.
- Use
mark-web for favicons, regular PWA icons, and tray icons.
- Use
mark-app for apple touch, maskable PWA icons, desktop app icons, .ico, and .icns.
- Add background by default to web favicons, regular PWA icons, maskable PWA icons,
apple-touch-icon.png, desktop/icon.png, desktop/icons/*.png, desktop/icon.ico, and desktop/icon.icns.
- Apply rounded backgrounds by default to web favicon outputs and regular PWA icons because those contexts do not consistently auto-mask icons.
- Add transparent outer inset to larger rounded web PNGs by default:
favicon-48x48.png uses 0.04, favicon.png uses 0.06, and regular PWA icons use 0.08; favicon-16x16.png, favicon-32x32.png, and favicon.ico use no outer inset to preserve small-size clarity.
- Keep
apple-touch-icon.png, maskable PWA icons, and desktop app icons as full square backgrounds because those contexts may apply platform masking or need full icon resources.
- Keep tray icons and source marks transparent by default.
- Create macOS tray template images as black template PNGs with transparent alpha.
Validation
After generation, verify:
- source marks are
RGBA, 512x512, and have transparent corners.
- fill-mark inputs additionally produce
mark-app-line and mark-web-line; line-mark inputs do not.
- web PNG dimensions match their filenames.
- web favicon outputs and regular PWA icons have transparent rounded corners and expected outer inset by default.
- maskable PWA icons and
apple-touch-icon.png have opaque background corners by default.
favicon.ico contains 16x16, 32x32, and 48x48.
- desktop PNG dimensions match their filenames.
icon.ico and tray.ico contain 16, 24, 32, 48, 64, 128, and 256 sizes.
- square default-background outputs have the requested background color at the corners.
preview.png exists.
Report the output directory, generated groups, key files, and validation summary.
1---2name: brand-asset-generator3description: Use when generating or wiring project-ready brand image assets from a user-provided logo, mark, or icon source image, including transparent source marks, favicon, PWA icons, apple touch icons, desktop app icons, tray icons, ICO, and ICNS outputs.4---56# Brand Asset Generator78Generate a reusable image asset package from one logo, mark, or icon source image.910## Workflow11121. Confirm the source image path and intended output target.132. If the user wants integration into an existing app, inspect the project first and identify the expected public/static/icon paths.143. Generate assets into `brand/<name>/` under the target project root, or into `<output-dir>/<name>/` when requested.154. Copy generated files into app paths only when the user asks for integration or the project clearly already has matching icon paths.165. Verify generated dimensions, transparency/background behavior, and any copied project references.1718## Use When1920- The user provides a source image and wants project-ready brand or logo assets.21- The user needs transparent app/web source marks with different padding.22- The user needs favicon, PWA, apple touch, desktop app, tray, `.ico`, or `.icns` outputs.23- The user wants a configurable background color for outputs that should not stay transparent.24- The user wants generated assets placed into an existing web, PWA, Electron, Tauri, or desktop-app project.2526## Do Not Use2728- Do not use for designing a new logo from scratch.29- Do not assume project-specific output paths before inspecting the target project.30- Do not copy generated files into application folders unless the user asks for integration or matching paths already exist.31- Do not add image-processing dependencies to the target project just to run this local generator.3233## Required Inputs3435Require:3637- `--input <file>`: source image path.3839Use `--name <name>` when the source marks need a stable prefix. If omitted, derive it from the input filename.40By default, assets are written to `brand/<name>/` under the current working directory. Use `--output-dir <dir>` only when the user wants to override the output parent directory.4142## Script4344Run the bundled script:4546```bash47python3 <skill-dir>/scripts/generate_brand_assets.py \48 --input path/to/source.png \49 --name brand \50 --profile all \51 --background "#ffffff"52```5354Options:5556- `--profile source|web|desktop|all`: choose the output group; default is `all`.57- `--output-dir <dir>`: override the default output parent directory; assets are written to `<dir>/<name>/`.58- `--background "#rrggbb"`: default background for non-transparent outputs; default is `#ffffff`.59- `--web-fill <0..1>`: visible subject scale for web source mark; default is `0.86`.60- `--app-fill <0..1>`: visible subject scale for app/desktop source mark; default is `0.68`.61- `--favicon-corner-radius <0..0.5>`: rounded background radius ratio for favicon outputs; default is `0.18`.62- `--web-corner-radius <0..0.5>`: rounded background radius ratio for regular PWA web icons; default is `0.22`.63- `--favicon-container-inset <0..0.4>`: override transparent outer inset for favicon PNG outputs; default is per-size.64- `--web-container-inset <0..0.4>`: transparent outer inset for regular PWA web icons; default is `0.08`.65- `--line-width-ratio <0..0.2>`: outline thickness for fill-derived line source marks; default is `0.035`.66- `--background-threshold <n>`: RGB edge-background removal tolerance; default is `28`.67- `--force-background`: apply background to all generated PNG and ICO/ICNS outputs.68- `--transparent-background`: keep outputs transparent even when they normally get the default background.6970If Pillow is missing, install it in the active Python environment:7172```bash73python3 -m pip install --user pillow74```7576## Project Placement7778When integrating generated assets into a project, prefer existing conventions over new paths:7980- Web/static apps: place favicons and PWA icons in the configured public/static root, commonly `public/`, `static/`, or app-specific asset folders.81- Next.js/App Router: check `app/icon.*`, `app/apple-icon.*`, `public/`, and metadata config before adding files.82- Vite/React/Vue/Svelte apps: check `public/`, `index.html`, and any manifest file before replacing favicons.83- PWA projects: update the existing `manifest.json` or `site.webmanifest` only when icon paths need to change.84- Electron/Tauri/desktop projects: check the builder config for icon paths before copying `desktop/icon.*` or tray images.8586If there is no existing convention and the user did not request direct integration, report the generated output directory instead of choosing an app path.8788## Output Contract8990The script writes a folder under `brand/` named from `--name` or the input filename slug. For example, `--name sample-brand` writes:9192```text93brand/94 sample-brand/95 source/96 sample-brand-mark-app.png97 sample-brand-mark-web.png98 sample-brand-mark-app-line.png # only when the input source is detected as fill99 sample-brand-mark-web-line.png # only when the input source is detected as fill100 web/101 favicon-16x16.png102 favicon-32x32.png103 favicon-48x48.png104 favicon.png105 favicon.ico106 icon-192.png107 icon-512.png108 icon-192-maskable.png109 icon-512-maskable.png110 apple-touch-icon.png111 desktop/112 icon.icns113 icon.ico114 icon.png115 icons/116 16x16.png117 24x24.png118 32x32.png119 48x48.png120 64x64.png121 96x96.png122 128x128.png123 256x256.png124 512x512.png125 1024x1024.png126 tray.ico127 tray.png128 trayTemplate.png129 trayTemplate@2x.png130 preview.png131```132133When `--output-dir <dir>` is provided, the same `source/`, `web/`, `desktop/`, and `preview.png` structure is written under `<dir>/<name>/`.134135## Generation Rules136137- Remove only the edge-connected background for RGB sources; keep same-colored interior details.138- Preserve existing alpha when the input already has transparency.139- Write source marks as 512x512 RGBA transparent PNGs.140- When the source subject is detected as a fill mark, also write 512x512 RGBA transparent line variants as `mark-app-line` and `mark-web-line`.141- Control fill-derived line thickness with `--line-width-ratio`; the value is multiplied by the cropped source subject's largest side.142- Do not create fill variants for line-mark inputs.143- Use `mark-web` for favicons, regular PWA icons, and tray icons.144- Use `mark-app` for apple touch, maskable PWA icons, desktop app icons, `.ico`, and `.icns`.145- Add background by default to web favicons, regular PWA icons, maskable PWA icons, `apple-touch-icon.png`, `desktop/icon.png`, `desktop/icons/*.png`, `desktop/icon.ico`, and `desktop/icon.icns`.146- Apply rounded backgrounds by default to web favicon outputs and regular PWA icons because those contexts do not consistently auto-mask icons.147- Add transparent outer inset to larger rounded web PNGs by default: `favicon-48x48.png` uses `0.04`, `favicon.png` uses `0.06`, and regular PWA icons use `0.08`; `favicon-16x16.png`, `favicon-32x32.png`, and `favicon.ico` use no outer inset to preserve small-size clarity.148- Keep `apple-touch-icon.png`, maskable PWA icons, and desktop app icons as full square backgrounds because those contexts may apply platform masking or need full icon resources.149- Keep tray icons and source marks transparent by default.150- Create macOS tray template images as black template PNGs with transparent alpha.151152## Validation153154After generation, verify:155156- source marks are `RGBA`, 512x512, and have transparent corners.157- fill-mark inputs additionally produce `mark-app-line` and `mark-web-line`; line-mark inputs do not.158- web PNG dimensions match their filenames.159- web favicon outputs and regular PWA icons have transparent rounded corners and expected outer inset by default.160- maskable PWA icons and `apple-touch-icon.png` have opaque background corners by default.161- `favicon.ico` contains 16x16, 32x32, and 48x48.162- desktop PNG dimensions match their filenames.163- `icon.ico` and `tray.ico` contain 16, 24, 32, 48, 64, 128, and 256 sizes.164- square default-background outputs have the requested background color at the corners.165- `preview.png` exists.166167Report the output directory, generated groups, key files, and validation summary.