A command line tool and Swift package for generating image assets for Apple platforms.
Assetool
is a SwiftUI app built on top of AssetKit
. Free download from Mac App Store.
Please download prebuilt binaries from Releases.
- Clone this repo,
cd
into the base directory. - Run
swift build -c release
. - Binaries are located in
.build/release
.
The CLI assetool
supports subcommands for generating both .appiconset
and .imageset
. Default subcommand is icon
.
assetool <input> [-o <output>] [-p <platforms>] [--universal]
-o, --output <output>
: Path of the output folder. If empty, will use current path of terminal.
-p, --platforms <platforms>
: Valid values are: ios
, mac
, macos
, watch
, watchos
. You can also generate an icon set with multiple platform idioms by sending a string of multiple values separated by comma, e.g. ios,mac,watch
.
-u, --universal
Generates single size for iOS and watchOS, suited for newer Xcode.
assetool image <input> [-o <output>] [--width <width>] [--height <height>]
--width <width>
and --height <height>
: @1x width or height of the exported image set. If empty, will use the original width/height as @3x size.
The osx-iconset
subcommand generates OS X .iconset
format. See Icon Set Type for details.
assetool osx-iconset <input> [-o <output>]
dependencies: [
.package(url: "https://github.com/xnth97/AssetKit", from: "1.2.1"),
],
AssetKit.generateIconSet(
inputPath: input,
outputPath: output,
platforms: [.ios, .mac])
AssetKit.generateImageSet(
inputPath: input,
outputPath: output,
width: width,
height: height)
The project is released under MIT license. Please see LICENSE for full terms.