zoukankan      html  css  js  c++  java
  • icns图标的制作

    1. 准备一张无损的png图片(1024x1024)

    2. 新建一个文件夹 必须要以iconset为后缀

       $ mkdir hgl_pngpic.iconset

    3. 使用sips 命令剪切10个不一样的图片(sips的用法)

       $ sips -z 16 16 mmm.png --out hgl_pngpic.iconset/icon_16x16.png

         .

         .

         .

    4. 整合成一张icns的图片

       $ iconutil -c icns hgl_pngpic.iconset -o hgl.icns

    此时当前文件夹下面的hgl.icns 就是你想要的图标啦。

    注:你也是可以自己写一个sh文件,在图片文件夹下面执行  $ mkIcons.sh filename.png

    #!/bin/bash
    
    hgl=$1
    
    echo '当前需要转换的文件地址为' $hgl
    
    # 创建一个文件夹 必须要以iconset为后缀
    mkdir hgl_pngpic.iconset
    
    # 使用sips命令生成 10张小图
    sips -z 16 16 $hgl --out hgl_pngpic.iconset/icon_16x16.png
    sips -z 32 32 $hgl --out hgl_pngpic.iconset/icon_16x16@2x.png
    
    sips -z 32 32 $hgl --out hgl_pngpic.iconset/icon_32x32.png
    sips -z 64 64 $hgl --out hgl_pngpic.iconset/icon_32x32@2x.png
    
    sips -z 128 128 $hgl --out hgl_pngpic.iconset/icon_128x128.png
    sips -z 256 256 $hgl --out hgl_pngpic.iconset/icon_128x128@2x.png
    
    sips -z 256 256 $hgl --out hgl_pngpic.iconset/icon_256x256.png
    sips -z 512 512 $hgl --out hgl_pngpic.iconset/icon_256x256@2x.png
    
    sips -z 512 512 $hgl --out hgl_pngpic.iconset/icon_512x512.png
    sips -z 1024 1024 $hgl --out hgl_pngpic.iconset/icon_512x512@2x.png
    
    # 使用iconutil命令将文件夹下的10张小图整合为一张icns图片
    iconutil -c icns hgl_pngpic.iconset -o hgl.icns
    
    # 清理中间产物 即文件夹及里面的10张图片
    rm -rf hgl_pngpic.iconset
    
  • 相关阅读:
    费马小定理
    CF 1365D Solve The Maze
    CF 1367D Task On The Board
    CF 1368B Codeforces Subsequences
    CF 1368C Even Picture
    mybatis框架
    Ajax
    jdbc
    jQuery
    JSP
  • 原文地址:https://www.cnblogs.com/gulong/p/10607502.html
Copyright © 2011-2022 走看看