mcpField
I
icon-generator

icon-generator

github.com/anhaoDesign & UI284 installsUpdated 32w ago
Repository

About icon-generator

A skill and bundled Python script for exporting Android and iOS app icon assets from a source image. It offers controls for fitting, background, corner radius, extra sizes, and optional Android adaptive icon resources.

Key features

  1. 01Export Android and iOS icon assets
  2. 02Contain or cover image fitting
  3. 03Set padding background color
  4. 04Apply rounded corners
  5. 05Generate extra PNG sizes
  6. 06Optional Android adaptive icons

Use cases

  1. 01Generate app icons from a logo image
  2. 02Create icons with padding or center cropping
  3. 03Export extra square PNG sizes
  4. 04Prepare Android adaptive icon resources

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/anhao/icon-generator-skill --skill icon-generator

After installing, type/icon-generatorin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
LICENSE
agents/
openai.yaml
references/
usage.md
scripts/
icon_generator.py

Details

From the project README

Icon Generator

Overview

Use the bundled script to turn one source image into Android and iOS app icon assets. Prefer this skill when the task is deterministic icon export rather than manual image editing.

Quick Start

  1. Confirm the input image path.
  2. Run python3 scripts/icon_generator.py <input-image> -o <output-dir>.
  3. Inspect the generated android/ and ios/AppIcon.appiconset/ folders.

Install Pillow first if needed:

python3 -m pip install 'Pillow>=10.0.0'

Workflow

Choose output behavior
  • Use the default contain mode when the full logo must stay visible and padding is acceptable.
  • Use cover when the icon must fill the square and center-cropping is acceptable.
  • Use --background to control padding color for non-square sources.
  • Use --corner-radius when the exported icons should already include rounded corners.
  • Use --extra-sizes when the user wants additional square PNGs beyond the built-in Android and iOS sizes.
  • Use --android-adaptive when the user explicitly needs Android adaptive icon resources.
Run the script

Basic export:

python3 scripts/icon_generator.py input.png -o output_icons

Export with crop, white padding, extra sizes, and rounded corners:

python3 scripts/icon_generator.py input.png \
  -o output_icons \
  --mode cover \
  --background '#FFFFFFFF' \
  --extra-sizes 256 384 \
  --corner-radius 18

Export Android adaptive icons too:

python3 scripts/icon_generator.py input.png \
  -o output_icons \
  --android-adaptive \
  --adaptive-background '#FFFFFF'

Validate Result

  • Check android/mipmap-* for launcher PNGs.
  • Check android/play-store/play_store_icon.png for the 512px store asset.
  • Check ios/AppIcon.appiconset/Contents.json plus the generated PNG files.
  • If adaptive icons were requested, check android/mipmap-anydpi-v26/ for the XML files and ic_launcher_foreground.png / ic_launcher_background.png.

Troubleshooting

  • If the script exits with a Pillow import error, install Pillow and rerun.
  • If colors fail to parse, pass #RRGGBB or #RRGGBBAA.
  • If the source image is missing, stop and confirm the path before regenerating.
  • If the user asks for non-square outputs or hand-tuned retouching, this skill is the wrong tool; use an image editing workflow instead.

Resources

  • Use scripts/icon_generator.py for the actual export.
  • Read references/usage.md for argument details, size lists, and output structure.

Comments

Markdown supported