Skip to content

Offline CLI that generates Android mipmap icons + iOS AppIcon.appiconset from a single PNG. Includes CI-friendly --check and optional ZIP output.

License

Notifications You must be signed in to change notification settings

dotsystemsdevs/app-icon-resizer

App Icon Resizer

CI License: MIT Node.js Version

Offline CLI to generate Android and iOS app icons from a single PNG. Includes CI validation mode.

Features

  • Generate all required Android mipmap icons (mdpi through xxxhdpi)
  • Generate all required iOS AppIcon.appiconset icons with Contents.json
  • Single command to generate both platforms
  • CI-friendly validation mode with exit codes
  • Optional ZIP archive output

Installation

# Install globally
npm install -g app-icon-resizer

# Or use with npx
npx app-icon-resizer icon.png --out ./icons

Quick Start

# Generate both Android and iOS icons
icon-resizer icon.png --out ./icons

# Generate Android only
icon-resizer icon.png --out ./icons --android

# Generate iOS only
icon-resizer icon.png --out ./icons --ios

# Create ZIP archive
icon-resizer icon.png --out ./icons --zip

# Validate input (for CI)
icon-resizer icon.png --check

CLI Options

Option Description
--out <dir> Output directory (required for generation)
--android Generate Android icons only
--ios Generate iOS icons only
--zip Create ZIP archive of output
--check Validate input only (for CI)
--help Show help
--version Show version

Output Structure

Android

<output>/android/
  mipmap-mdpi/ic_launcher.png      (48x48)
  mipmap-hdpi/ic_launcher.png      (72x72)
  mipmap-xhdpi/ic_launcher.png     (96x96)
  mipmap-xxhdpi/ic_launcher.png    (144x144)
  mipmap-xxxhdpi/ic_launcher.png   (192x192)

iOS

<output>/ios/
  AppIcon.appiconset/
    Contents.json
    [email protected]    (40x40)
    [email protected]    (60x60)
    [email protected]    (58x58)
    [email protected]    (87x87)
    [email protected]    (80x80)
    [email protected]    (120x120)
    [email protected]    (120x120)
    [email protected]    (180x180)
    icon-1024.png     (1024x1024)

Requirements

  • Input: PNG image, square (width = height)
  • Recommended size: 1024x1024 pixels
  • Minimum size: 40x40 pixels (will produce warnings if < 1024)

CI Integration

Use --check to validate icons in your CI pipeline:

# GitHub Actions example
- name: Validate app icon
  run: npx app-icon-resizer ./assets/icon.png --check

Exit codes:

  • 0: Validation passed
  • 1: Validation failed (file not found, not PNG, not square, or < 1024x1024)

FAQ

Why must the image be square?

Both Android and iOS require square app icons. Non-square images would be distorted or cropped unpredictably, so we enforce this at input time.

What happens if my image is smaller than 1024x1024?

In generate mode: The tool will warn you but continue generating icons (as long as the image is at least 40x40). Quality may be reduced for larger output sizes.

In --check mode: The tool will fail with exit code 1. This is useful for CI pipelines where you want to enforce quality standards.

Does this support Android adaptive icons?

Not yet. Adaptive icons require separate foreground and background layers. This is planned for a future release. Currently, the tool generates traditional ic_launcher.png icons.

Limitations

  • No Android adaptive icon support (foreground/background layers)
  • iPhone icons only (no iPad, watchOS, or macOS)
  • Fixed output filenames (ic_launcher.png for Android)

Roadmap

  • --strict flag to fail on undersized images during generation
  • Android adaptive icons support
  • Custom output filename via --name
  • Auto-detect and place icons in React Native/Flutter projects
  • iPad, watchOS, and macOS icon support

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

License

MIT

About

Offline CLI that generates Android mipmap icons + iOS AppIcon.appiconset from a single PNG. Includes CI-friendly --check and optional ZIP output.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •