Mac 自动操作 制作程序

原理

将 png 转换成 icns 图标
目前只能 使用 png 格式 市场上已经有类似的app,image2icon

1
2
3
4
5
6
7
8
9
10
11
12
sips -z 16 16     pic.png --out icons.iconset/icon_16x16.png
sips -z 32 32 pic.png --out icons.iconset/icon_16x16@2x.png
sips -z 32 32 pic.png --out icons.iconset/icon_32x32.png
sips -z 64 64 pic.png --out icons.iconset/icon_32x32@2x.png
sips -z 64 64 pic.png --out icons.iconset/icon_64x64.png
sips -z 128 128 pic.png --out icons.iconset/icon_64x64@2x.png
sips -z 128 128 pic.png --out icons.iconset/icon_128x128.png
sips -z 256 256 pic.png --out icons.iconset/icon_128x128@2x.png
sips -z 256 256 pic.png --out icons.iconset/icon_256x256.png
sips -z 512 512 pic.png --out icons.iconset/icon_256x256@2x.png
sips -z 512 512 pic.png --out icons.iconset/icon_512x512.png
sips -z 1024 1024 pic.png --out icons.iconset/icon_512x512@2x.png
1
iconutil -c icns icons.iconset -o Icon.icns

自动操作

 Mac > 自动操作 > 搜索 shell > 传递输入 > 作为自变量

20210103165405955750.png

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
mkdir ${1%/*}/icons.iconset/
sips -z 16 16 $1 --out ${1%/*}/icons.iconset/icon_16x16.png
sips -z 32 32 $1 --out ${1%/*}/icons.iconset/icon_16x16@2x.png
sips -z 32 32 $1 --out ${1%/*}/icons.iconset/icon_32x32.png
sips -z 64 64 $1 --out ${1%/*}/icons.iconset/icon_32x32@2x.png
sips -z 64 64 $1 --out ${1%/*}/icons.iconset/icon_64x64.png
sips -z 128 128 $1 --out ${1%/*}/icons.iconset/icon_64x64@2x.png
sips -z 128 128 $1 --out ${1%/*}/icons.iconset/icon_128x128.png
sips -z 256 256 $1 --out ${1%/*}/icons.iconset/icon_128x128@2x.png
sips -z 256 256 $1 --out ${1%/*}/icons.iconset/icon_256x256.png
sips -z 512 512 $1 --out ${1%/*}/icons.iconset/icon_256x256@2x.png
sips -z 512 512 $1 --out ${1%/*}/icons.iconset/icon_512x512.png
sips -z 1024 1024 $1 --out ${1%/*}/icons.iconset/icon_512x512@2x.png
iconutil -c icns ${1%/*}/icons.iconset -o ${1%/*}/ApplicationStub.icns
rm -rf ${1%/*}/icons.iconset/

换个风格

20210103165700121401.png

修改图标

  • 20210103165836839037.png

  • 20210103165925764024.png

  • 20210103170304132040.png

转换

20210103170730451536.png

20210103170801876648.png

修改

20210103170903606571.png

  • 空格预览

20210103170939275658.png

快点去批量修改吧!

20210103171402953525.png

下载

写好的程序 链接: 密码: btjs

XRSec has the right to modify and interpret this article. If you want to reprint or disseminate this article, you must ensure the integrity of this article, including all contents such as copyright notice. Without the permission of the author, the content of this article shall not be modified or increased or decreased arbitrarily, and it shall not be used for commercial purposes in any way