A simple CLI tool to convert an input PNG into all the required formats for iOS. Like launch icons, settings icons, spotlight, etc. In all the required formats for iPad, iPad Pro, iPhone, 2x, 3x etc. Should save you some time.
Note: your source file needs to be at least as large as the largest format required. I.e. for iOS, this is currently 1024x1024px.
You can grab a binary build here:
/usr/local/bin
or something for easy access. Off course, it also works with a direct path to the executable.The easiest way to build the application is using Swift Package Manager. From Terminal:
# cd /path/to/repo
# swift build
[4/4] Linking AppIconResizer
# cd .build/debug
You can now use the command from this directory using ./AppIconResizer <image>
.
You probably want to "install" it by copying it to a location within path. I also recommend copying the file as a lower-case only command appiconresizer
. For example:
# sudo cp AppIconResizer /usr/local/bin/appiconresizer
Use: # appiconresizer <inputfile>
Example:
# appiconresizer icon.png
Using file icon.png.
Setting base image name: icon
...
# ls -l
-rw-r--r--@ 1 maartene staff 1047358 24 sep 19:30 icon.png
-rw-r--r--@ 1 maartene staff 1945292 24 sep 19:58 icon.pxm
-rw-r--r-- 1 maartene staff 1281021 24 sep 19:30 icon_1024x1024.png
-rw-r--r-- 1 maartene staff 22589 24 sep 19:30 icon_120x120.png
-rw-r--r-- 1 maartene staff 34876 24 sep 19:30 icon_152x152.png
-rw-r--r-- 1 maartene staff 41234 24 sep 19:30 icon_167x167.png
-rw-r--r-- 1 maartene staff 48156 24 sep 19:30 icon_180x180.png
-rw-r--r-- 1 maartene staff 1035 24 sep 19:30 icon_20x20.png
-rw-r--r-- 1 maartene staff 1830 24 sep 19:30 icon_29x29.png
-rw-r--r-- 1 maartene staff 3208 24 sep 19:30 icon_40x40.png
-rw-r--r-- 1 maartene staff 5995 24 sep 19:30 icon_58x58.png
-rw-r--r-- 1 maartene staff 6463 24 sep 19:30 icon_60x60.png
-rw-r--r-- 1 maartene staff 9813 24 sep 19:30 icon_76x76.png
-rw-r--r-- 1 maartene staff 10690 24 sep 19:30 icon_80x80.png
-rw-r--r-- 1 maartene staff 12432 24 sep 19:30 icon_87x87.png
-o <directory>
: specify an output directory (where the generated files are stored)-v
: show version information-h
: show helpIllegal instruction: 4
. This might be the case if the file to convert is not large enough. But this requires further investigationlink |
Stars: 0 |
Last commit: 4 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics