Skip to content

icon and logo generator

the tool/generate.dart script generates launcher icons and brand logos from a single source PNG. it is intentionally minimal: it only handles the app icon and logo assets, not the larger icon data maps that the Pyggo generator produces.

dependencies

the generator needs the image and args packages. both are already listed under dev_dependencies in pubspec.yaml:

  • args — command-line argument parsing.
  • image — decoding, resizing, and encoding PNG/ICO assets.

usage

both commands take a source PNG as an argument. the source should be at least 1024x1024 and have a transparent background if you want adaptive icons.

# generate launcher icons for Android, iOS, macOS, Windows, and Linux
# and update assets/images/app_icon.png.
dart run tool/generate.dart app assets/brand/app_icon_source.png

# generate brand logos for the about screen, splash screen, and docs
dart run tool/generate.dart logo assets/brand/app_icon_source.png

you can also write generated files to a different directory:

dart run tool/generate.dart app assets/brand/app_icon_source.png -o /tmp/output

outputs

app produces:

  • android/app/src/main/res/mipmap-*/ic_launcher.png
  • android/app/src/main/res/mipmap-*/ic_launcher_dev.png — an inverted copy of the source, selected by tool/build.sh --dev builds through the appIcon manifest placeholder so dev installs are visually distinct on the launcher
  • ios/Runner/Assets.xcassets/AppIcon.appiconset/*.png
  • macos/Runner/Assets.xcassets/AppIcon.appiconset/*.png
  • windows/runner/resources/app_icon.ico
  • linux/runner/resources/know_that_you_are_breathing.png
  • assets/images/app_icon.png

logo produces:

  • assets/brand/app_logo.png
  • assets/brand/android12_splash.png
  • docs/assets/know_that_you_are_breathing_logo_200.png

source asset

the app command keeps a copy of the original source at assets/brand/app_icon_source.png. the source is not bundled by default; the generated assets/images/app_icon.png is the asset the app references at runtime.